28 lines
1.5 KiB
JSON
28 lines
1.5 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/common/envelope.schema.json",
|
|
"title": "CommandEnvelope",
|
|
"description": "Fields every Bambu MQTT command/response shares, across both protocol generations - unversioned, at the bambulab/ root, not duplicated under v1/ or v2/. This is the 'base class' - other schemas extend it via allOf + $ref. JSON Schema doesn't have inheritance either, strictly speaking (no 'extends' keyword) - allOf is composition: it says the instance must satisfy THIS schema AND whatever else is listed alongside it. It's the closest thing to real inheritance ergonomics of anything used across this project's schema stack (proto, Rust), because $ref + allOf lets you name and reuse a shape without re-declaring its fields, which proto/Rust composition can't quite do (there you still write `common: PrinterReportCommon` by hand on every struct).",
|
|
"type": "object",
|
|
"properties": {
|
|
"sequence_id": {
|
|
"type": "string",
|
|
"description": "Sequence ID matching the original request"
|
|
},
|
|
"command": {
|
|
"type": "string",
|
|
"description": "Command being reported on"
|
|
},
|
|
"result": {
|
|
"type": "string",
|
|
"enum": ["success", "fail", "SUCCESS", "FAIL"],
|
|
"description": "Result status (case-insensitive)"
|
|
},
|
|
"reason": {
|
|
"type": "string",
|
|
"description": "Optional reason or error message"
|
|
}
|
|
},
|
|
"required": ["sequence_id", "command"]
|
|
}
|