UNPKG

@alius/rpc

Version:

JSON-RPC 2.0 implementation configured with OpenRPC

60 lines (59 loc) 1 kB
{ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "https://www.jsonrpc.org/schema/response", "type": "object", "properties": { "jsonrpc": { "type": "string", "enum": [ "2.0" ] }, "id": { "type": [ "string", "number", "null" ], "minLength": 1 } }, "oneOf": [ { "properties": { "result": {} }, "required": [ "jsonrpc", "id", "result" ] }, { "properties": { "error": { "type": "object", "properties": { "code": { "type": "integer" }, "message": { "type": "string", "minLength": 1 }, "data": {} }, "required": [ "code", "message" ] } }, "required": [ "jsonrpc", "id", "error" ] } ] }