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.
This commit is contained in:
2026-09-05 20:40:56 +00:00
parent 952b5e1eca
commit b35fdf9e6a
25 changed files with 301 additions and 119 deletions
-25
View File
@@ -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
}
@@ -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"
]
}
]
}
@@ -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"
]
}
]
}
@@ -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
}
@@ -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
}
@@ -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"]
}
]
}
@@ -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"]
}
]
}
@@ -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"]
}
]
}
]
}
-31
View File
@@ -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
}
+24
View File
@@ -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"]
}
]
}