e.json-schema-validator.1.99.4.source-code.jsonrpc-response-2.0.json Maven / Gradle / Ivy
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "A JSON RPC 2.0 response",
"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" ] }
},
"oneOf": [
{ "$ref": "#/definitions/success" },
{ "$ref": "#/definitions/error" }
],
"definitions": {
"success": {
"required": [ "id", "jsonrpc", "result" ],
"properties": {
"result": {
"type": "object",
"note": [
"apart from the result being an object, there are no constraints"
]
}
},
"additionalProperties": false
},
"error": {
"type": "object",
"required": [ "id", "jsonrpc", "code", "message" ],
"properties": {
"code": {
"type": "integer",
"note": "nothing in the spec says that it is required"
},
"message": {
"note": "not required",
"type": "string"
},
"data": {}
},
"additionalPropertes": false
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy