85 lines
2.9 KiB
JSON
85 lines
2.9 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$id": "https://freecad.org/schemas/freecad-web-cam-create-recompute-v1.json",
|
|
"oneOf": [
|
|
{ "$ref": "#/$defs/request" },
|
|
{ "$ref": "#/$defs/result" },
|
|
{ "$ref": "#/$defs/error" }
|
|
],
|
|
"$defs": {
|
|
"payload": {
|
|
"type": "object",
|
|
"required": ["schema", "fixture", "objectType", "gcode"],
|
|
"properties": {
|
|
"schema": { "const": "freecad-web-cam/create-recompute/v1" },
|
|
"fixture": { "const": "CAMKernelDocument" },
|
|
"objectType": { "const": "Path::Feature" },
|
|
"gcode": { "type": "string", "minLength": 1 }
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"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": { "const": "cam.createRecompute" },
|
|
"payload": { "$ref": "#/$defs/payload" },
|
|
"documentId": { "type": "string", "minLength": 1 }
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"typedResult": {
|
|
"type": "object",
|
|
"required": ["schema", "module", "action", "document", "object", "path", "recompute", "stateSha256"],
|
|
"properties": {
|
|
"schema": { "const": "freecad-web-cam/create-recompute/v1" },
|
|
"module": { "const": "CAM" },
|
|
"action": { "const": "create/recompute" },
|
|
"document": { "type": "object" },
|
|
"object": { "type": "object" },
|
|
"path": { "type": "object" },
|
|
"recompute": { "type": "object" },
|
|
"stateSha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" }
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"result": {
|
|
"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": { "$ref": "#/$defs/typedResult" }
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"error": {
|
|
"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
|
|
}
|
|
}
|
|
}
|