From b35fdf9e6afbc1d87d48f5fbe56987164ebd3f80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iwo=20Strzebo=C5=84ski?= Date: Sat, 5 Sep 2026 20:40:56 +0000 Subject: [PATCH] Restructure continuum/v1 domain schemas: material/printer/vendor model Replaces the old flat material/print_job/print_params/template schemas with a richer structure: schemas/continuum/common/ for shared envelope + enums (material_type taxonomy, printer_type), schemas/continuum/v1/ material/ (material + spool) and printer/ (printer_info/firmware_info/ module_info), plus a new vendor.schema.json. Fixes found while verifying (all files added in this pass, so nothing downstream depended on the broken paths yet): - 5 broken $refs to common/envelope.schema.json - files under the new v1/material/ and v1/printer/ subdirectories need ../../common/, not ../common/ (one more level of nesting than vendor.schema.json, which sits directly under v1/). - $id in 5 files (material.schema.json, spool.schema.json, firmware_info/module_info/printer_info.schema.json) didn't match their real path - mostly copy-paste from before the material/printer/ subdirectories existed. - $id in all 13 files under common/material_type/ and common/printer_type.enum.json said v1/ instead of common/. - material.schema.json's hardness_value used minItems (an array-only keyword, silently ignored on an integer) where minimum: 0 was evidently intended, matching the maximum: 100 next to it. Not fixed, needs a decision rather than a mechanical correction: - spool.schema.json's `required` list is material.schema.json's fields (material_type, min_nozzle_temp, ...), none of which exist in spool's own properties (material, empty_spool_weight, ...) - copy-paste left over from material.schema.json. continuum-schema-instance's error message points right at it: "'material_type' is required but has no schema in properties". - envelope.schema.json's created_by/updated_by are typed format: date-time (copy-pasted from created_at/updated_at) - almost certainly meant to identify an actor, not a timestamp. - printer_info.schema.json requires `host` via a oneOf (ipv4-or-ipv6 format) nested inside an allOf branch - continuum-schema-instance doesn't merge a oneOf nested inside allOf (only plain properties/required), so it currently builds an empty {} for this schema; also worth confirming ipv4/ipv6-only is intended, since it'd reject a DNS hostname. - print_job.schema.json and print_params.schema.json were removed with no replacement under the new structure - confirm that's intentional. Also: the hand-written TypeBox schemas (ts-types) and serde structs (rust-types) for Material/Template/PrintJob/PrintParameters now describe the OLD flat shape and are out of sync with this restructure - per this repo's hand-sync convention (see README), they need updating to match, or the old ones should be removed if these new schemas supersede them. --- schemas/continuum/common/envelope.schema.json | 13 ++++++ .../material_type/_elastomers.enum.json | 7 ++++ .../material_type/_fluoropolymers.enum.json | 7 ++++ .../common/material_type/_others.enum.json | 7 ++++ .../common/material_type/_pla.enum.json | 7 ++++ .../material_type/_polyamides.enum.json | 7 ++++ .../material_type/_polycarbonates.enum.json | 7 ++++ .../material_type/_polyesters.enum.json | 7 ++++ .../material_type/_polyolefins.enum.json | 7 ++++ .../common/material_type/_soluble.enum.json | 7 ++++ .../common/material_type/_styrenics.enum.json | 7 ++++ .../material_type/_ultra_polymers.enum.json | 7 ++++ .../common/material_type/fdm.enum.json | 18 +++++++++ .../common/material_type/modifier.enum.json | 9 +++++ .../continuum/common/printer_type.enum.json | 17 ++++++++ schemas/continuum/v1/material.schema.json | 25 ------------ .../v1/material/material.schema.json | 40 +++++++++++++++++++ .../continuum/v1/material/spool.schema.json | 29 ++++++++++++++ schemas/continuum/v1/print_job.schema.json | 40 ------------------- schemas/continuum/v1/print_params.schema.json | 23 ----------- .../v1/printer/firmware_info.schema.json | 16 ++++++++ .../v1/printer/module_info.schema.json | 20 ++++++++++ .../v1/printer/printer_info.schema.json | 38 ++++++++++++++++++ schemas/continuum/v1/template.schema.json | 31 -------------- schemas/continuum/v1/vendor.schema.json | 24 +++++++++++ 25 files changed, 301 insertions(+), 119 deletions(-) create mode 100644 schemas/continuum/common/envelope.schema.json create mode 100644 schemas/continuum/common/material_type/_elastomers.enum.json create mode 100644 schemas/continuum/common/material_type/_fluoropolymers.enum.json create mode 100644 schemas/continuum/common/material_type/_others.enum.json create mode 100644 schemas/continuum/common/material_type/_pla.enum.json create mode 100644 schemas/continuum/common/material_type/_polyamides.enum.json create mode 100644 schemas/continuum/common/material_type/_polycarbonates.enum.json create mode 100644 schemas/continuum/common/material_type/_polyesters.enum.json create mode 100644 schemas/continuum/common/material_type/_polyolefins.enum.json create mode 100644 schemas/continuum/common/material_type/_soluble.enum.json create mode 100644 schemas/continuum/common/material_type/_styrenics.enum.json create mode 100644 schemas/continuum/common/material_type/_ultra_polymers.enum.json create mode 100644 schemas/continuum/common/material_type/fdm.enum.json create mode 100644 schemas/continuum/common/material_type/modifier.enum.json create mode 100644 schemas/continuum/common/printer_type.enum.json delete mode 100644 schemas/continuum/v1/material.schema.json create mode 100644 schemas/continuum/v1/material/material.schema.json create mode 100644 schemas/continuum/v1/material/spool.schema.json delete mode 100644 schemas/continuum/v1/print_job.schema.json delete mode 100644 schemas/continuum/v1/print_params.schema.json create mode 100644 schemas/continuum/v1/printer/firmware_info.schema.json create mode 100644 schemas/continuum/v1/printer/module_info.schema.json create mode 100644 schemas/continuum/v1/printer/printer_info.schema.json delete mode 100644 schemas/continuum/v1/template.schema.json create mode 100644 schemas/continuum/v1/vendor.schema.json diff --git a/schemas/continuum/common/envelope.schema.json b/schemas/continuum/common/envelope.schema.json new file mode 100644 index 0000000..d0810da --- /dev/null +++ b/schemas/continuum/common/envelope.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/continuum/common/envelope.schema.json", + "title": "MessageEnvelope", + "type": "object", + "properties": { + "id": { "type": "string", "format": "uuid" }, + "created_at": { "type": "string", "format": "date-time" }, + "created_by": { "type": "string", "format": "date-time" }, + "updated_at": { "type": "string", "format": "date-time" }, + "updated_by": { "type": "string", "format": "date-time" } + } +} diff --git a/schemas/continuum/common/material_type/_elastomers.enum.json b/schemas/continuum/common/material_type/_elastomers.enum.json new file mode 100644 index 0000000..91eb8d2 --- /dev/null +++ b/schemas/continuum/common/material_type/_elastomers.enum.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/continuum/common/material_type/_elastomers.enum.json", + "title": "MaterialTypeElastomersEnum", + "type": "string", + "enum": ["TPU", "TPE", "TPC", "TPR", "OBC", "PEBA"] +} diff --git a/schemas/continuum/common/material_type/_fluoropolymers.enum.json b/schemas/continuum/common/material_type/_fluoropolymers.enum.json new file mode 100644 index 0000000..a9504c0 --- /dev/null +++ b/schemas/continuum/common/material_type/_fluoropolymers.enum.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/continuum/common/material_type/_fluoropolymers.enum.json", + "title": "MaterialTypeFluoropolymersEnum", + "type": "string", + "enum": ["PVDF", "PTFE", "FEP", "PFA"] +} diff --git a/schemas/continuum/common/material_type/_others.enum.json b/schemas/continuum/common/material_type/_others.enum.json new file mode 100644 index 0000000..b7975e0 --- /dev/null +++ b/schemas/continuum/common/material_type/_others.enum.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/continuum/common/material_type/_others.enum.json", + "title": "MaterialTypeOthersEnum", + "type": "string", + "enum": ["POM", "PMMA", "PUR", "CUSTOM"] +} diff --git a/schemas/continuum/common/material_type/_pla.enum.json b/schemas/continuum/common/material_type/_pla.enum.json new file mode 100644 index 0000000..15aa0cc --- /dev/null +++ b/schemas/continuum/common/material_type/_pla.enum.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/continuum/common/material_type/_pla.enum.json", + "title": "MaterialTypePlaEnum", + "type": "string", + "enum": ["PLA", "PHA", "PCL"] +} diff --git a/schemas/continuum/common/material_type/_polyamides.enum.json b/schemas/continuum/common/material_type/_polyamides.enum.json new file mode 100644 index 0000000..693b7e2 --- /dev/null +++ b/schemas/continuum/common/material_type/_polyamides.enum.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/continuum/common/material_type/_polyamides.enum.json", + "title": "MaterialTypePolyamidesEnum", + "type": "string", + "enum": ["PA", "PA6", "PA6/66", "PA11", "PA12", "PA-MXD6"] +} diff --git a/schemas/continuum/common/material_type/_polycarbonates.enum.json b/schemas/continuum/common/material_type/_polycarbonates.enum.json new file mode 100644 index 0000000..2caba44 --- /dev/null +++ b/schemas/continuum/common/material_type/_polycarbonates.enum.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/continuum/common/material_type/_polycarbonates.enum.json", + "title": "MaterialTypePolycarbonatesEnum", + "type": "string", + "enum": ["PC", "PC-PTFE", "PC-ABS", "PC-PBT", "PC-PETG"] +} diff --git a/schemas/continuum/common/material_type/_polyesters.enum.json b/schemas/continuum/common/material_type/_polyesters.enum.json new file mode 100644 index 0000000..fd0ecfe --- /dev/null +++ b/schemas/continuum/common/material_type/_polyesters.enum.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/continuum/common/material_type/_polyesters.enum.json", + "title": "MaterialTypePolyestersEnum", + "type": "string", + "enum": ["PET", "PETG", "PETT", "PCTG", "CPE", "PBT"] +} diff --git a/schemas/continuum/common/material_type/_polyolefins.enum.json b/schemas/continuum/common/material_type/_polyolefins.enum.json new file mode 100644 index 0000000..0e1a33d --- /dev/null +++ b/schemas/continuum/common/material_type/_polyolefins.enum.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/continuum/common/material_type/_polyolefins.enum.json", + "title": "MaterialTypePolyolefinsEnum", + "type": "string", + "enum": ["PP", "PE", "HDPE", "LDPE", "COC"] +} diff --git a/schemas/continuum/common/material_type/_soluble.enum.json b/schemas/continuum/common/material_type/_soluble.enum.json new file mode 100644 index 0000000..7113fc3 --- /dev/null +++ b/schemas/continuum/common/material_type/_soluble.enum.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/continuum/common/material_type/_soluble.enum.json", + "title": "MaterialTypeSolubleEnum", + "type": "string", + "enum": ["PVA", "PVB", "BVOH", "TIMEMASS"] +} diff --git a/schemas/continuum/common/material_type/_styrenics.enum.json b/schemas/continuum/common/material_type/_styrenics.enum.json new file mode 100644 index 0000000..598382a --- /dev/null +++ b/schemas/continuum/common/material_type/_styrenics.enum.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/continuum/common/material_type/_styrenics.enum.json", + "title": "MaterialTypeStyrenicsEnum", + "type": "string", + "enum": ["ABS", "ASA", "HIPS", "SBC", "PS", "SAN", "SMA"] +} diff --git a/schemas/continuum/common/material_type/_ultra_polymers.enum.json b/schemas/continuum/common/material_type/_ultra_polymers.enum.json new file mode 100644 index 0000000..0370d3c --- /dev/null +++ b/schemas/continuum/common/material_type/_ultra_polymers.enum.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/continuum/common/material_type/_ultra_polymers.enum.json", + "title": "MaterialTypeUltrapolymersEnum", + "type": "string", + "enum": ["PEEK", "PEKK", "PEI", "ULTEM", "PAEK", "PPS", "PPSU", "PSU", "PES", "PESU", "PAI", "PI"] +} diff --git a/schemas/continuum/common/material_type/fdm.enum.json b/schemas/continuum/common/material_type/fdm.enum.json new file mode 100644 index 0000000..02818a0 --- /dev/null +++ b/schemas/continuum/common/material_type/fdm.enum.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/continuum/common/material_type/fdm.enum.json", + "title": "MaterialTypeFdmEnum", + "oneOf": [ + { "$ref": "./_pla.enum.json" }, + { "$ref": "./_styrenics.enum.json" }, + { "$ref": "./_polyesters.enum.json" }, + { "$ref": "./_polyamides.enum.json" }, + { "$ref": "./_polycarbonates.enum.json" }, + { "$ref": "./_elastomers.enum.json" }, + { "$ref": "./_ultra_polymers.enum.json" }, + { "$ref": "./_polyolefins.enum.json" }, + { "$ref": "./_fluoropolymers.enum.json" }, + { "$ref": "./_soluble.enum.json" }, + { "$ref": "./_others.enum.json" } + ] +} diff --git a/schemas/continuum/common/material_type/modifier.enum.json b/schemas/continuum/common/material_type/modifier.enum.json new file mode 100644 index 0000000..61ce96f --- /dev/null +++ b/schemas/continuum/common/material_type/modifier.enum.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/continuum/common/material_type/modifier.enum.json", + "title": "MaterialTypeModifierFdmEnum", + "type": "string", + "enum": [ + "", "+", "LW", "CF", "GF", "ESD", "FR", "Wood", "Metal", "Pure" + ] +} diff --git a/schemas/continuum/common/printer_type.enum.json b/schemas/continuum/common/printer_type.enum.json new file mode 100644 index 0000000..952971a --- /dev/null +++ b/schemas/continuum/common/printer_type.enum.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/continuum/common/printer_type.enum.json", + "title": "PrinterTypeEnum", + "type": "string", + "enum": [ + "SLA", + "DLP", + "FDM", + "SLS", + "SLM", + "EBM", + "LOM", + "BJ", + "MJ" + ] +} diff --git a/schemas/continuum/v1/material.schema.json b/schemas/continuum/v1/material.schema.json deleted file mode 100644 index 32f79aa..0000000 --- a/schemas/continuum/v1/material.schema.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/continuum/v1/material.schema.json", - "title": "MaterialProfile", - "type": "object", - "properties": { - "id": { "type": "string", "format": "uuid" }, - "name": { "type": "string", "minLength": 1 }, - "filamentType": { "type": "string", "minLength": 1 }, - "nozzleTempC": { "type": "number" }, - "bedTempC": { "type": "number" }, - "densityGCm3": { "type": "number" }, - "colorHex": { "type": "string", "pattern": "^#[0-9a-fA-F]{6}$" } - }, - "required": [ - "id", - "name", - "filamentType", - "nozzleTempC", - "bedTempC", - "densityGCm3", - "colorHex" - ], - "additionalProperties": false -} diff --git a/schemas/continuum/v1/material/material.schema.json b/schemas/continuum/v1/material/material.schema.json new file mode 100644 index 0000000..7519f49 --- /dev/null +++ b/schemas/continuum/v1/material/material.schema.json @@ -0,0 +1,40 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/continuum/v1/material/material.schema.json", + "title": "MaterialSchema", + "allOf": [ + { "$ref": "../../common/envelope.schema.json" }, + { + "type": "object", + "properties": { + "material_type": { "$ref": "../../common/material_type/fdm.enum.json" }, + "material_modifier": { + "$ref": "../../common/material_type/modifier.enum.json" + }, + "min_nozzle_temp": { "type": "integer", "minimum": 0 }, + "max_nozzle_temp": { "type": "integer", "minimum": 0 }, + "min_bed_temp": { "type": "integer", "minimum": 0 }, + "max_bed_temp": { "type": "integer", "minimum": 0 }, + "min_chamber_temp": { "type": "integer", "minimum": 0 }, + "max_chamber_temp": { "type": "integer", "minimum": 0 }, + "density": { "type": "number" }, + "name": { "type": "string" }, + "hardness_value": { "type": "integer", "minimum": 0, "maximum": 100 }, + "hardness_scale": { "type": "string", "enum": ["A", "D"] }, + "vendor": { "$ref": "../vendor.schema.json" } + }, + "required": [ + "material_type", + "material_modifier", + "min_nozzle_temp", + "max_nozzle_temp", + "min_bed_temp", + "max_bed_temp", + "min_chamber_temp", + "max_chamber_temp", + "density", + "name" + ] + } + ] +} diff --git a/schemas/continuum/v1/material/spool.schema.json b/schemas/continuum/v1/material/spool.schema.json new file mode 100644 index 0000000..56688aa --- /dev/null +++ b/schemas/continuum/v1/material/spool.schema.json @@ -0,0 +1,29 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/continuum/v1/material/spool.schema.json", + "title": "SpoolSchema", + "allOf": [ + { "$ref": "../../common/envelope.schema.json" }, + { + "type": "object", + "properties": { + "material": { "$ref": "./material.schema.json" }, + "empty_spool_weight": { "type": "number" }, + "max_material_weight": { "type": "number" }, + "current_material_weight": { "type": "number" } + }, + "required": [ + "material_type", + "material_modifier", + "min_nozzle_temp", + "max_nozzle_temp", + "min_bed_temp", + "max_bed_temp", + "min_chamber_temp", + "max_chamber_temp", + "density", + "name" + ] + } + ] +} diff --git a/schemas/continuum/v1/print_job.schema.json b/schemas/continuum/v1/print_job.schema.json deleted file mode 100644 index d4b542d..0000000 --- a/schemas/continuum/v1/print_job.schema.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/continuum/v1/print_job.schema.json", - "title": "PrintJob", - "type": "object", - "properties": { - "id": { "type": "string", "format": "uuid" }, - "farmId": { "type": "string", "format": "uuid" }, - "printerId": { "type": "string", "format": "uuid" }, - "templateId": { "type": "string", "format": "uuid" }, - "status": { - "type": "string", - "enum": [ - "PRINT_JOB_STATUS_UNSPECIFIED", - "PRINT_JOB_STATUS_QUEUED", - "PRINT_JOB_STATUS_PRINTING", - "PRINT_JOB_STATUS_PAUSED", - "PRINT_JOB_STATUS_COMPLETED", - "PRINT_JOB_STATUS_FAILED", - "PRINT_JOB_STATUS_CANCELLED" - ] - }, - "progressPercent": { "type": "number", "minimum": 0, "maximum": 100 }, - "startedAtUnix": { "type": "integer" }, - "completedAtUnix": { "type": "integer" }, - "gcodeFileKey": { "type": "string", "minLength": 1 } - }, - "required": [ - "id", - "farmId", - "printerId", - "templateId", - "status", - "progressPercent", - "startedAtUnix", - "completedAtUnix", - "gcodeFileKey" - ], - "additionalProperties": false -} diff --git a/schemas/continuum/v1/print_params.schema.json b/schemas/continuum/v1/print_params.schema.json deleted file mode 100644 index 41183ce..0000000 --- a/schemas/continuum/v1/print_params.schema.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/continuum/v1/print_params.schema.json", - "title": "PrintParameters", - "type": "object", - "properties": { - "layerHeightMm": { "type": "number", "minimum": 0.04, "maximum": 1.0 }, - "infillPercent": { "type": "integer", "minimum": 0, "maximum": 100 }, - "infillPattern": { "type": "string", "minLength": 1 }, - "printSpeedMmS": { "type": "number", "minimum": 0 }, - "supportsEnabled": { "type": "boolean" }, - "wallCount": { "type": "integer", "minimum": 0 } - }, - "required": [ - "layerHeightMm", - "infillPercent", - "infillPattern", - "printSpeedMmS", - "supportsEnabled", - "wallCount" - ], - "additionalProperties": false -} diff --git a/schemas/continuum/v1/printer/firmware_info.schema.json b/schemas/continuum/v1/printer/firmware_info.schema.json new file mode 100644 index 0000000..4e58175 --- /dev/null +++ b/schemas/continuum/v1/printer/firmware_info.schema.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/continuum/v1/printer/firmware_info.schema.json", + "title": "FirmwareInfoSchema", + "allOf": [ + { "$ref": "../../common/envelope.schema.json" }, + { + "type": "object", + "properties": { + "version": { "type": "string" }, + "product_name": { "type": "string" } + }, + "required": ["version"] + } + ] +} diff --git a/schemas/continuum/v1/printer/module_info.schema.json b/schemas/continuum/v1/printer/module_info.schema.json new file mode 100644 index 0000000..498d0ef --- /dev/null +++ b/schemas/continuum/v1/printer/module_info.schema.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/continuum/v1/printer/module_info.schema.json", + "title": "ModuleInfoSchema", + "allOf": [ + { "$ref": "../../common/envelope.schema.json" }, + { + "type": "object", + "properties": { + "name": { "type": "string" }, + "product_name": { "type": "string" }, + "sn": { "type": "string" }, + "visible": { "type": "boolean" }, + "firmware_version": { "type": "string" }, + "hardware_version": { "type": "string" } + }, + "required": ["name", "firmware_version"] + } + ] +} diff --git a/schemas/continuum/v1/printer/printer_info.schema.json b/schemas/continuum/v1/printer/printer_info.schema.json new file mode 100644 index 0000000..f0a3812 --- /dev/null +++ b/schemas/continuum/v1/printer/printer_info.schema.json @@ -0,0 +1,38 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/continuum/v1/printer/printer_info.schema.json", + "title": "PrinterInfoSchema", + "allOf": [ + { "$ref": "../../common/envelope.schema.json" }, + { + "type": "object", + "properties": { + "sn": { "type": "string" }, + "firmware_info": { "$ref": "./firmware_info.schema.json" }, + "modules": { + "type": "array", + "items": { "$ref": "./module_info.schema.json" } + }, + "vendor": { "$ref": "../vendor.schema.json" } + } + }, + { + "oneOf": [ + { + "type": "object", + "properties": { + "host": { "type": "string", "format": "ipv4" } + }, + "required": ["host"] + }, + { + "type": "object", + "properties": { + "host": { "type": "string", "format": "ipv6" } + }, + "required": ["host"] + } + ] + } + ] +} diff --git a/schemas/continuum/v1/template.schema.json b/schemas/continuum/v1/template.schema.json deleted file mode 100644 index 196fa92..0000000 --- a/schemas/continuum/v1/template.schema.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/continuum/v1/template.schema.json", - "title": "Template", - "type": "object", - "properties": { - "id": { "type": "string", "format": "uuid" }, - "name": { "type": "string", "minLength": 1 }, - "description": { "type": "string" }, - "ownerId": { "type": "string", "format": "uuid" }, - "modelFileKey": { "type": "string", "minLength": 1 }, - "material": { "$ref": "material.schema.json" }, - "printParameters": { "$ref": "print_params.schema.json" }, - "createdAtUnix": { "type": "integer" }, - "updatedAtUnix": { "type": "integer" }, - "tags": { "type": "array", "items": { "type": "string" } } - }, - "required": [ - "id", - "name", - "description", - "ownerId", - "modelFileKey", - "material", - "printParameters", - "createdAtUnix", - "updatedAtUnix", - "tags" - ], - "additionalProperties": false -} diff --git a/schemas/continuum/v1/vendor.schema.json b/schemas/continuum/v1/vendor.schema.json new file mode 100644 index 0000000..37ecdd4 --- /dev/null +++ b/schemas/continuum/v1/vendor.schema.json @@ -0,0 +1,24 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/continuum/v1/vendor.schema.json", + "title": "VendorSchema", + "type": "object", + "allOf": [ + { "$ref": "../common/envelope.schema.json" }, + { + "type": "object", + "properties": { + "name": { "type": "string" }, + "email": { "type": "string", "format": "email" }, + "phone": { "type": "string" }, + "address_line1": { "type": "string" }, + "address_line2": { "type": "string" }, + "postal_code": { "type": "string" }, + "city": { "type": "string" }, + "county": { "type": "string" }, + "country_code": { "type": "string" } + }, + "required": ["name"] + } + ] +}