Versioning
How the schema is versioned, how it differs from an individual MView's version, and the URL scheme.
Versioning
There are two independent version numbers involved, and it's easy to conflate them.
Schema version — $schema
The schema itself is versioned via its URL path:
https://schemas.carmenlabs.com/mview/v1/schema.jsonv1 is the schema major version. A manifest declares which schema version it conforms to via
the $schema field, and that value is a const — a v1 manifest must reference the v1
schema URL exactly. There is no $schema: "v1.2" — schema evolution that doesn't break existing
manifests happens within v1 (e.g. new optional fields, new enum values). A breaking change
(removing a field, changing required-ness, or changing semantics of an existing field) cannot be
published under this schema URL. The V1 contract and tooling remain unchanged.
MView version — version
Each individual mview.json also carries its own semantic version:
"version": "1.0.0"This tracks the MView itself — its parser and component — not the schema. Bump it when you regenerate or hand-edit the parser or component in a way worth tracking. It has no bearing on which schema the manifest validates against.
Why the URL includes the version
Publishing the schema at the versioned URL /mview/v1/schema.json means:
- Tooling can pin to a specific schema version and won't be broken by a future breaking change.
- A manifest is self-describing —
$schematells any validator, editor, or agent exactly which rules apply, without out-of-band coordination. - MViews keep validating against the same V1 contract.
Practical implication for implementers
If you're building a runtime or validator, resolve the schema from the manifest's own $schema
field. Validate it against the published V1 schema rather than an unversioned or inferred contract.
