Configuration Options Reference

Comprehensive guide to all configuration options available for the JSON-RPC tools suite

On this page

Try the tools

Experience the JSON-RPC tools with default or custom configuration.

Explore Tools

Overview

The JSON-RPC tools suite offers extensive configuration options to customize the behavior of each tool according to your specific needs. This reference document provides a comprehensive list of all available configuration options for each tool in the suite.

Configuration options can be specified in several ways:

  • Through the web interface for each tool
  • Via command-line arguments when using the CLI tools
  • In configuration files when integrating with build systems
  • Through API parameters when using the JavaScript libraries

Validator Options

The JSON-RPC Validator supports the following configuration options:

OptionTypeDefaultDescription
versionstring"2.0"JSON-RPC protocol version to validate against ("1.0" or "2.0")
strictModebooleantrueEnforce strict validation according to the specification
allowExtraFieldsbooleanfalseAllow additional fields not defined in the specification
validateParamsbooleantrueValidate parameter types and structure if schema is provided
batchLimitnumber100Maximum number of requests allowed in a batch request
maxDepthnumber20Maximum depth for nested objects and arrays

Usage Example

Web Interface

In the web interface, these options are available in the settings panel of the Validator tool.

Command Line

npx jsonrpc-validator --version=1.0 --strictMode=false --allowExtraFields=true ./api/schema.json

API Usage

import { validateJsonRpc } from '@jsonrpc-tools/validator';

const result = validateJsonRpc(jsonRpcMessage, {
  version: '2.0',
  strictMode: true,
  allowExtraFields: false,
  validateParams: true,
  batchLimit: 50,
  maxDepth: 10
});

Generator Options

The JSON-RPC Generator supports these configuration options:

OptionTypeDefaultDescription
versionstring"2.0"JSON-RPC protocol version to generate ("1.0" or "2.0")
idGeneratorfunctionautoFunction to generate request IDs (numeric, string, or null)
paramsStylestring"auto"Style for parameters: "array", "object", or "auto"
errorDatabooleantrueInclude data field in error responses
batchModebooleanfalseGenerate batch requests/responses

Tester Options

The JSON-RPC Request Tester has these configuration options:

OptionTypeDefaultDescription
timeoutnumber30000Request timeout in milliseconds
headersobject{}Custom HTTP headers to include with requests
validateResponsebooleantrueValidate responses against JSON-RPC specification
corsbooleantrueInclude CORS headers in requests
credentialsstring"same-origin"Credentials mode for fetch requests

Global Options

These global options apply to multiple tools in the suite:

OptionTypeDefaultDescription
themestring"light"UI theme ("light", "dark", or "system")
saveSettingsbooleantrueSave user settings in local storage
debugbooleanfalseEnable debug mode with additional logging
languagestring"en"UI language (when multiple languages are supported)

Note: Configuration options can be exported and imported using the settings menu in each tool. This allows you to save and share your preferred configurations.