Skip to content

Instantly share code, notes, and snippets.

@vagabondan
Created June 9, 2023 17:14
Show Gist options
  • Save vagabondan/31cb34bd5d63980db4201564f54b1db2 to your computer and use it in GitHub Desktop.
Save vagabondan/31cb34bd5d63980db4201564f54b1db2 to your computer and use it in GitHub Desktop.
Full jsonrpc2.0 jsonschema with batched requests support
{
"id": "jsonrpc2.0",
"anyOf": [
{ "$ref": "#/definitions/jsonrpc2Schema" },
{
"type": "array",
"description": "batched requests",
"items": { "$ref": "#/definitions/jsonrpc2Schema" }
}
],
"definitions": {
"jsonrpc2Schema": {
"type": "object",
"required": true,
"additionalProperties": false,
"properties": {
"jsonrpc": {
"name": "jsonrpc",
"type": "string",
"required": true,
"enum": [
"2.0"
],
"addionalPropeties": false
},
"id": {
"name": "id",
"type": [
"null",
"number",
"string"
],
"required": true,
"addionalPropeties": false
},
"method": {
"name": "method",
"type": "string",
"required": true,
"addionalPropeties": false
},
"params": {
"name": "params",
"type": [
"object",
"array"
]
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment