Files
continuum-schemas/schemas/bambulab/v1/report/print/ams_tray.schema.json
T
octoturge cd18337e12 Category subdirectories for request/report; ams/xcam split; print vs pushing fix
Each root JSON key ('info', 'pushing', 'print') now gets its own category
folder under request/ and report/, so a category can hold multiple command
schemas without flattening them into one directory - v1/request.schema.json
and v1/report.schema.json route into these via oneOf per category (also
future-proofs for a category ever needing more than one shape).

Split pushall's ams/xcam fields the same way module_info was already
split: ams.schema.json/ams_unit.schema.json/ams_tray.schema.json/
xcam.schema.json/print.schema.json, each referencing the next by relative
$ref. ams_tray.schema.json uses oneOf for the empty-vs-loaded tray shapes
- verified (and initially got wrong, then fixed) that LoadedTray needs
every field required, not just id, or a bare {"id":"0"} validates
against both branches and oneOf fails, since oneOf demands exactly one
match.

Real correction: the report/ category for what a pushall request
triggers is "print", not "pushing" - re-reading the original examples,
pushall's REQUEST goes to "pushing", but the resulting state-push stream
arrives under "print", a different root key. report/pushing/ (my
original mistake) is removed; report/print/ holds the corrected content.
request/pushing/ is untouched - that side was correct.

Also: v2/ removed (found as broken copy-pasted stubs still pointing at
v1 $ids - no real V2-specific content yet, better to have nothing than
broken duplicates); all $ids switched to real, verified Gitea raw-file
URLs (raw/branch/main/<path> - confirmed this is the correct pattern,
not raw/<path>) instead of a placeholder domain; fixed a broken relative
$ref in the request-side files left over from an earlier move (still
pointing 2 levels up instead of 3 after nesting one level deeper).

Re-validated everything against real examples after restructuring,
including the full ams/xcam print report and two negative cases -
see schemas/bambulab/README.md for the validation script.
2026-08-28 23:17:32 +00:00

49 lines
2.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/v1/report/print/ams_tray.schema.json",
"title": "AmsTray",
"description": "A tray slot is either empty (just `id`) or loaded (the full field set) — two genuinely different shapes for the same slot, not one shape with optional fields. oneOf says the instance must match EXACTLY one of these. Note LoadedTray requires every field it lists, not just `id` — with only `id` required, a bare {\"id\":\"0\"} would validate against BOTH branches at once (it trivially satisfies Loaded's single requirement too) and oneOf would fail, since oneOf demands exactly one match. Verified this the hard way — see git history. The Rust equivalent is an untagged enum with #[serde(deny_unknown_fields)] on the Empty variant, for the same reason in reverse: without it, a loaded tray's extra fields wouldn't be rejected by Empty, and untagged enums try variants in order — see bambu_commands/print.rs.",
"oneOf": [
{
"title": "EmptyTray",
"type": "object",
"properties": {
"id": { "type": "string" }
},
"required": ["id"],
"additionalProperties": false
},
{
"title": "LoadedTray",
"type": "object",
"properties": {
"id": { "type": "string" },
"bed_temp": { "type": "string" },
"bed_temp_type": { "type": "string" },
"cols": { "type": "array", "items": { "type": "string" } },
"drying_temp": { "type": "string" },
"drying_time": { "type": "string" },
"nozzle_temp_max": { "type": "string" },
"nozzle_temp_min": { "type": "string" },
"remain": { "type": "integer" },
"tag_uid": { "type": "string" },
"tray_color": { "type": "string" },
"tray_diameter": { "type": "string" },
"tray_id_name": { "type": "string" },
"tray_info_idx": { "type": "string" },
"tray_sub_brands": { "type": "string" },
"tray_type": { "type": "string" },
"tray_uuid": { "type": "string" },
"tray_weight": { "type": "string" },
"xcam_info": { "type": "string" }
},
"required": [
"id", "bed_temp", "bed_temp_type", "cols", "drying_temp", "drying_time",
"nozzle_temp_max", "nozzle_temp_min", "remain", "tag_uid", "tray_color",
"tray_diameter", "tray_id_name", "tray_info_idx", "tray_sub_brands",
"tray_type", "tray_uuid", "tray_weight", "xcam_info"
]
}
]
}