Files
FreeCADWasmDev/docs/p6/inspection-facade.schema.json
wangdequan 9a7c4f0335 Save FreeCAD Web workspace sources and user validation evidence
IFC native binding remains incomplete; preserve accurate test results.
2026-09-15 22:01:58 +08:00

104 lines
4.4 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://freecad.org/schemas/freecad-web-inspection-create-recompute-v1.json",
"oneOf": [
{ "$ref": "#/$defs/request" },
{ "$ref": "#/$defs/cancel" },
{ "$ref": "#/$defs/success" },
{ "$ref": "#/$defs/failure" }
],
"$defs": {
"payload": {
"type": "object",
"required": ["schema", "module", "action", "fixtureId", "actual", "nominal", "searchRadius"],
"properties": {
"schema": { "const": "freecad-web-inspection/create-recompute/v1" },
"module": { "const": "Inspection" },
"action": { "const": "create/recompute" },
"fixtureId": { "const": "inspection-box-2x3x4-identical-v1" },
"actual": { "$ref": "#/$defs/box" },
"nominal": { "$ref": "#/$defs/box" },
"searchRadius": { "const": 10 }
},
"additionalProperties": false
},
"box": {
"type": "object",
"required": ["type", "length", "width", "height"],
"properties": {
"type": { "const": "Part::Box" },
"length": { "const": 2 },
"width": { "const": 3 },
"height": { "const": 4 }
},
"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": "inspection.createRecompute" },
"payload": { "$ref": "#/$defs/payload" },
"documentId": { "const": "inspection-doc" }
},
"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": { "const": "inspection-doc" }
},
"additionalProperties": false
},
"typedResult": {
"type": "object",
"required": ["schema", "module", "action", "document", "inspection", "recompute", "resourcesReleased", "stateSha256"],
"properties": {
"schema": { "const": "freecad-web-inspection/create-recompute/v1" },
"module": { "const": "Inspection" },
"action": { "const": "create/recompute" },
"document": { "type": "object", "required": ["name", "objectCount", "activeAfterClose"], "properties": { "name": { "const": "InspectionKernelDocument" }, "objectCount": { "const": 3 }, "activeAfterClose": { "const": 0 } }, "additionalProperties": false },
"inspection": { "type": "object", "required": ["distanceCount", "rms", "hasError"], "properties": { "distanceCount": { "type": "integer", "minimum": 1 }, "rms": { "type": "number", "minimum": 0 }, "hasError": { "const": 0 } }, "additionalProperties": false },
"recompute": { "type": "object", "required": ["count", "hasError"], "properties": { "count": { "const": 1 }, "hasError": { "const": 0 } }, "additionalProperties": false },
"resourcesReleased": { "const": true },
"stateSha256": { "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": { "$ref": "#/$defs/typedResult" }
},
"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
}
}
}