chore: schema reorganization
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
"$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.schema.json",
|
"$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v1/common/ams.schema.json",
|
||||||
"title": "AmsState",
|
"title": "AmsState",
|
||||||
"description": "Bambu's own naming has the outer container and the inner array both called `ams` - print.ams.ams, not a typo here, just what the printer actually sends.",
|
"description": "Bambu's own naming has the outer container and the inner array both called `ams` - print.ams.ams, not a typo here, just what the printer actually sends.",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
"$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",
|
"$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v1/common/ams_tray.schema.json",
|
||||||
"title": "AmsTray",
|
"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. `drying_time` and `drying_temp` fields are only available for AMS 2 and AMS HT - AMS 1 doesn't have the drying option.",
|
"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. `drying_time` and `drying_temp` fields are only available for AMS 2 and AMS HT - AMS 1 doesn't have the drying option.",
|
||||||
"oneOf": [
|
"oneOf": [
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
"$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_unit.schema.json",
|
"$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v1/common/ams_unit.schema.json",
|
||||||
"title": "AmsUnit",
|
"title": "AmsUnit",
|
||||||
"description": "One physical AMS unit (Bambu's numbering starts at 0 via `id`).",
|
"description": "One physical AMS unit (Bambu's numbering starts at 0 via `id`).",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
+6
-2
@@ -1,10 +1,14 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
"$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/_online.schema.json",
|
"$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v1/common/online.schema.json",
|
||||||
"title": "Online",
|
"title": "Online",
|
||||||
"description": "Printer online/offline status",
|
"description": "Printer online/offline status",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "object"
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"attr": { "type": "integer" },
|
||||||
|
"code": { "type": "integer" }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
"$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/_ipcam.schema.json",
|
"$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v1/common/ipcam.schema.json",
|
||||||
"title": "Ipcam",
|
"title": "Ipcam",
|
||||||
"description": "Report about the in-built IP camera",
|
"description": "Report about the in-built IP camera",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
"$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/_lights_report.schema.json",
|
"$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v1/common/lights_report.schema.json",
|
||||||
"title": "LightsReport",
|
"title": "LightsReport",
|
||||||
"description": "Report status of printer lights",
|
"description": "Report status of printer lights",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
|
"$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v1/common/module_info.schema.json",
|
||||||
|
"title": "ModuleInfo",
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"name": { "type": "string" },
|
||||||
|
"sw_ver": { "type": "string" },
|
||||||
|
"hw_ver": { "type": "string" },
|
||||||
|
"loader_ver": { "type": "string" },
|
||||||
|
"product_name": { "type": "string" },
|
||||||
|
"sn": { "type": "string" },
|
||||||
|
"visible": { "type": "boolean" },
|
||||||
|
"flag": { "type": "integer" }
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"name",
|
||||||
|
"sw_ver",
|
||||||
|
"hw_ver",
|
||||||
|
"loader_ver",
|
||||||
|
"sn",
|
||||||
|
"product_name",
|
||||||
|
"visible",
|
||||||
|
"flag"
|
||||||
|
]
|
||||||
|
}
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
"$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/_net.schema.json",
|
"$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v1/common/net.schema.json",
|
||||||
"title": "Net",
|
"title": "Net",
|
||||||
"description": "Network status",
|
"description": "Network status",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
"$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/_online.schema.json",
|
"$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v1/common/online.schema.json",
|
||||||
"title": "Online",
|
"title": "Online",
|
||||||
"description": "Printer online/offline status",
|
"description": "Printer online/offline status",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
+1
-1
@@ -6,7 +6,7 @@
|
|||||||
"properties": {
|
"properties": {
|
||||||
"sequence": { "type": "string" },
|
"sequence": { "type": "string" },
|
||||||
"progress": { "type": "string" },
|
"progress": { "type": "string" },
|
||||||
"status": { "type": "string", "enum": ["IDLE"]},
|
"status": { "type": "string", "enum": ["idle", "IDLE"]},
|
||||||
"consistency_request": { "type": "boolean" },
|
"consistency_request": { "type": "boolean" },
|
||||||
"dis_state": { "type": "integer" },
|
"dis_state": { "type": "integer" },
|
||||||
"err_code": { "type": "integer" },
|
"err_code": { "type": "integer" },
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
"command": { "const": "get_version" },
|
"command": { "const": "get_version" },
|
||||||
"module": {
|
"module": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": { "$ref": "_module_info.schema.json" }
|
"items": { "$ref": "../../common/module_info.schema.json" }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": ["module"]
|
"required": ["module"]
|
||||||
|
|||||||
@@ -10,16 +10,16 @@
|
|||||||
"properties": {
|
"properties": {
|
||||||
"command": { "const": "push_status" },
|
"command": { "const": "push_status" },
|
||||||
|
|
||||||
"upgrade_state": { "$ref": "_upgrade_state.schema.json" },
|
"upgrade_state": { "$ref": "../../common/upgrade_state.schema.json" },
|
||||||
"ipcam": { "$ref": "_ipcam.schema.json" },
|
"ipcam": { "$ref": "../../common/ipcam.schema.json" },
|
||||||
"upload": { "$ref": "_upload.schema.json" },
|
"upload": { "$ref": "../../common/upload.schema.json" },
|
||||||
"net": { "$ref": "_net.schema.json" },
|
"net": { "$ref": "../../common/net.schema.json" },
|
||||||
"hms": { "$ref": "_hms.schema.json" },
|
"hms": { "$ref": "../../common/hms.schema.json" },
|
||||||
"online": { "$ref": "_online.schema.json" },
|
"online": { "$ref": "../../common/online.schema.json" },
|
||||||
"ams": { "$ref": "_ams.schema.json" },
|
"ams": { "$ref": "../../common/ams.schema.json" },
|
||||||
"vt_tray": { "$ref": "_vt_tray.schema.json" },
|
"vt_tray": { "$ref": "../../common/vt_tray.schema.json" },
|
||||||
"lights_report": { "$ref": "_lights_report.schema.json" },
|
"lights_report": { "$ref": "../../common/lights_report.schema.json" },
|
||||||
"xcam": { "$ref": "_xcam.schema.json" },
|
"xcam": { "$ref": "../../common/xcam.schema.json" },
|
||||||
|
|
||||||
"nozzle_diameter": { "$ref": "../../common/nozzle_diameter.schema.json" },
|
"nozzle_diameter": { "$ref": "../../common/nozzle_diameter.schema.json" },
|
||||||
"nozzle_type": { "$ref": "../../common/nozzle_type.schema.json" },
|
"nozzle_type": { "$ref": "../../common/nozzle_type.schema.json" },
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
|
"$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v2/common/nozzle_diameter.schema.json",
|
||||||
|
"title": "NozzleDiameter",
|
||||||
|
"description": "Common schema for nozzle diameter",
|
||||||
|
"type": "number",
|
||||||
|
"enum": [
|
||||||
|
0.2,
|
||||||
|
0.4,
|
||||||
|
0.6,
|
||||||
|
0.8
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
|
"$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v1/common/nozzle_type.schema.json",
|
||||||
|
"title": "NozzleType",
|
||||||
|
"description": "Common schema for nozzle type. HS00 - stainless steel, HS01 - hardened steel, HS05 - tungsten carbide, HH01 - high-flow hardened steel, HH05 - high-flow tungsten carbide",
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"HS00",
|
||||||
|
"HS01",
|
||||||
|
"HS05",
|
||||||
|
"HH01",
|
||||||
|
"HH05"
|
||||||
|
]
|
||||||
|
}
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
"$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v1/report/info/_module_info.schema.json",
|
"$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v2/report/info/_module_info.schema.json",
|
||||||
"title": "ModuleInfo",
|
"title": "ModuleInfo",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
|
"$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v2/report/info/get_version.schema.json",
|
||||||
|
"title": "GetVersionReport",
|
||||||
|
"allOf": [
|
||||||
|
{ "$ref": "../../../common/envelope.schema.json" },
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"command": { "const": "get_version" },
|
||||||
|
"module": {
|
||||||
|
"type": "array",
|
||||||
|
"items": { "$ref": "_module_info.schema.json" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["module"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
|
"$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v2/request/info/get_version.schema.json",
|
||||||
|
"title": "GetVersionRequest",
|
||||||
|
"allOf": [
|
||||||
|
{ "$ref": "../../../common/envelope.schema.json" },
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"command": { "const": "get_version" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user