diff --git a/jsonrpc2.0/jsonrpc-request-2.0.json b/jsonrpc2.0/jsonrpc-request-2.0.json index dae29d2..44c4c0e 100644 --- a/jsonrpc2.0/jsonrpc-request-2.0.json +++ b/jsonrpc2.0/jsonrpc-request-2.0.json @@ -16,6 +16,7 @@ "request": { "type": "object", "required": [ "jsonrpc", "method" ], + "additionalProperties": false, "properties": { "jsonrpc": { "enum": [ "2.0" ] }, "method": { diff --git a/jsonrpc2.0/jsonrpc-response-2.0.json b/jsonrpc2.0/jsonrpc-response-2.0.json index 9182a4e..a7bb91c 100644 --- a/jsonrpc2.0/jsonrpc-response-2.0.json +++ b/jsonrpc2.0/jsonrpc-response-2.0.json @@ -15,54 +15,48 @@ } ], "definitions": { - "common": { - "required": [ "id", "jsonrpc" ], - "not": { - "description": "cannot have result and error at the same time", - "required": [ "result", "error" ] - }, - "type": "object", - "properties": { - "id": { - "type": [ "string", "integer", "null" ], - "note": [ - "spec says a number which should not contain a fractional part", - "We choose integer here, but this is unenforceable with some languages" - ] - }, - "jsonrpc": { "enum": [ "2.0" ] } - } + "id": { + "type": [ "string", "integer", "null" ], + "note": [ + "spec says a number which should not contain a fractional part", + "We choose integer here, but this is unenforceable with some languages" + ] }, + "jsonrpc": { "enum": [ "2.0" ] }, "success": { + "type": "object", "description": "A success. The result member is then required and can be anything.", - "allOf": [ - { "$ref": "#/definitions/common" }, - { "required": [ "result" ] } - ] + "required": [ "id", "jsonrpc", "result" ], + "additionalProperties": false, + "properties": { + "id": { "$ref": "#/definitions/id" }, + "jsonrpc": { "$ref": "#/definitions/jsonrpc" }, + "result": {} + } }, "error": { - "allOf" : [ - { "$ref": "#/definitions/common" }, - { - "required": [ "error" ], + "type": "object", + "required": [ "id", "jsonrpc", "error" ], + "additionalProperties": false, + "properties": { + "id": { "$ref": "#/definitions/id" }, + "jsonrpc": { "$ref": "#/definitions/jsonrpc" }, + "error": { + "type": "object", + "required": [ "code", "message" ], + "additionalProperties": false, "properties": { - "error": { - "type": "object", - "required": [ "code", "message" ], - "properties": { - "code": { - "type": "integer", - "note": [ "unenforceable in some languages" ] - }, - "message": { "type": "string" }, - "data": { - "description": "optional, can be anything" - } - } + "code": { + "type": "integer", + "note": [ "unenforceable in some languages" ] + }, + "message": { "type": "string" }, + "data": { + "description": "optional, can be anything" } } } - ] + } } } -} \ No newline at end of file +}