73 lines
2.5 KiB
JSON
73 lines
2.5 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$id": "https://freecad.org/schemas/freecad-web-cam-import-export-v1.json",
|
|
"oneOf": [
|
|
{ "$ref": "#/$defs/request" },
|
|
{ "$ref": "#/$defs/result" },
|
|
{ "$ref": "#/$defs/error" },
|
|
{ "$ref": "#/$defs/cancel" }
|
|
],
|
|
"$defs": {
|
|
"payload": {
|
|
"type": "object",
|
|
"required": ["schema", "fixture", "format", "content"],
|
|
"properties": {
|
|
"schema": { "const": "freecad-web-cam/import-export/v1" },
|
|
"fixture": { "const": "CAMImportExportDocument" },
|
|
"format": { "const": ".json" },
|
|
"content": { "type": "string" }
|
|
},
|
|
"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": { "enum": ["cam.import", "cam.export"] },
|
|
"payload": { "$ref": "#/$defs/payload" }
|
|
},
|
|
"additionalProperties": true
|
|
},
|
|
"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": { "type": "object", "required": ["schema", "module", "action", "format", "document", "object", "imported", "exported", "stateSha256"] }
|
|
},
|
|
"additionalProperties": true
|
|
},
|
|
"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"] }
|
|
},
|
|
"additionalProperties": true
|
|
},
|
|
"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 }
|
|
},
|
|
"additionalProperties": true
|
|
}
|
|
}
|
|
}
|