Move bambulab JSON Schemas here from continuum-proxy; restructure
Schemas (any notation - proto, JSON Schema) belong in the schemas repo regardless of how many languages currently consume them; that's what makes this 'the schemas repo'. Rust-only code (the hand-written structs in continuum-proxy's bambu_commands/) is a different category and stays where it was. Also restructured per readability feedback: - envelope.schema.json moved out of v1/ to the bambulab/ root - it's shared across protocol generations, not v1-specific, same principle already applied to the (now-removed) proto/bambulab/common.proto. - v1/ split into v1/request/ and v1/report/, one file per command in each, instead of *.request.schema.json / *.response.schema.json filename suffixes doing the same job less clearly. The two top-level dispatcher schemas (matching BambuRequest/BambuReport) stay at the v1/ root since they aren't themselves a single command's schema. Re-verified after restructuring, not just moved and assumed still correct: resolution now has to handle a real basename collision (get_version.schema.json exists in both request/ and report/) — switched the validation approach to register schemas by (their actual base URI) rather than by filename, which is what makes relative resolve correctly here. All three real examples plus the negative tests from the original version still pass.
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://continuum.internal/schemas/bambulab/v1/request.schema.json",
|
||||
"title": "BambuRequest",
|
||||
"description": "Matches continuum-proxy's src/printer/bambu_commands::BambuRequest — one JSON key naming the category ('info', 'pushing', ...), the value is that category's request schema.",
|
||||
"type": "object",
|
||||
"minProperties": 1,
|
||||
"maxProperties": 1,
|
||||
"properties": {
|
||||
"info": { "$ref": "request/get_version.schema.json" },
|
||||
"pushing": { "$ref": "request/pushall.schema.json" }
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
Reference in New Issue
Block a user