73 lines
2.4 KiB
JSON
73 lines
2.4 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$id": "https://freecad.org/schemas/freecad-web-facade-v1.json",
|
|
"oneOf": [
|
|
{ "$ref": "#/$defs/request" },
|
|
{ "$ref": "#/$defs/cancel" },
|
|
{ "$ref": "#/$defs/success" },
|
|
{ "$ref": "#/$defs/failure" }
|
|
],
|
|
"$defs": {
|
|
"request": {
|
|
"type": "object",
|
|
"required": ["schema", "version", "kind", "requestId", "command", "payload"],
|
|
"properties": {
|
|
"schema": { "const": "freecad-web-facade/v1" },
|
|
"version": { "const": 1 },
|
|
"kind": { "const": "request" },
|
|
"requestId": { "type": "string", "minLength": 1 },
|
|
"command": { "type": "string", "minLength": 1 },
|
|
"payload": {},
|
|
"documentId": { "type": "string", "minLength": 1 }
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"cancel": {
|
|
"type": "object",
|
|
"required": ["schema", "version", "kind", "requestId", "cancelOf"],
|
|
"properties": {
|
|
"schema": { "const": "freecad-web-facade/v1" },
|
|
"version": { "const": 1 },
|
|
"kind": { "const": "cancel" },
|
|
"requestId": { "type": "string", "minLength": 1 },
|
|
"cancelOf": { "type": "string", "minLength": 1 },
|
|
"documentId": { "type": "string", "minLength": 1 }
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"success": {
|
|
"type": "object",
|
|
"required": ["schema", "version", "kind", "requestId", "result"],
|
|
"properties": {
|
|
"schema": { "const": "freecad-web-facade/v1" },
|
|
"version": { "const": 1 },
|
|
"kind": { "const": "result" },
|
|
"requestId": { "type": "string", "minLength": 1 },
|
|
"result": {}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"failure": {
|
|
"type": "object",
|
|
"required": ["schema", "version", "kind", "requestId", "error"],
|
|
"properties": {
|
|
"schema": { "const": "freecad-web-facade/v1" },
|
|
"version": { "const": 1 },
|
|
"kind": { "const": "error" },
|
|
"requestId": { "type": "string", "minLength": 1 },
|
|
"error": {
|
|
"type": "object",
|
|
"required": ["code", "message"],
|
|
"properties": {
|
|
"code": { "type": "string", "minLength": 1 },
|
|
"message": { "type": "string", "minLength": 1 },
|
|
"diagnostic": { "type": "object" }
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
}
|
|
}
|