Add continuum-schema-instance: build JSON instances from a JSON Schema

The Rust equivalent of json-schema-faker, scoped to what's actually
useful in Rust: resolves $ref (relative to whichever file references
it)/allOf, fills const/enum/default, and builds a value only for
properties listed in required - everything else is left out. For code
that has to construct a raw serde_json::Value against a schema it
doesn't own, instead of a typed struct.

Verified against continuum-schemas' real bambulab schemas manually, and
against local fixtures in tests (round-tripped through the jsonschema
crate to confirm the output actually validates).
This commit is contained in:
2026-09-05 16:59:12 +00:00
parent c452cf0d78
commit fed19b260f
7 changed files with 384 additions and 0 deletions
+1
View File
@@ -6,5 +6,6 @@ Shared, dependency-light building blocks used across the Continuum cloud and edg
- **`packages/ts-core`** - TypeScript package consumed by `continuum-backend` (and other Bun/Node services). Provides a structured logger, a Supabase JWT verification helper, and ElysiaJS-compatible HTTP error transformers.
- **`packages/rust-core`** - Rust crate consumed by `continuum-proxy` and `continuum-ai-worker`. Provides a shared `thiserror`-based error type, `tracing` initialization, and G-code checksum/header parsing helpers.
- **`packages/rust-schema-instance`** - Rust crate consumed by `continuum-proxy` and `continuum-ai-worker`. Builds a `serde_json::Value` instance from a JSON Schema file (resolves `$ref`/`allOf`, fills `const`/`enum`/`default`, only builds `required` properties) - for code that has to construct a raw JSON message against some other system's schema instead of a typed struct.
Each package is versioned and published independently; see their own READMEs (inline doc comments) for usage.