Skip to content

ODCS: choose a schema object, notes for composite key and relationships - #462

Merged
nightmoose merged 3 commits into
stagingfrom
feat/odcs-schema-object
Nov 26, 2026
Merged

nightmoose merged 3 commits into
stagingfrom
feat/odcs-schema-object

Conversation

@nightmoose

Copy link
Copy Markdown
Owner

Follow-up to #458 (ODCS compatibility): the mapping gaps that can be closed without an engine change.

What changes

  • Multi-object schema. schema_object picks the object to import, by name (physicalName and id also match). The first is still the default, so nothing changes for existing files.
    • CLI: --schema-object NAME on validate, synth, test, enforce.
    • API: schema_object on POST /contracts/synth (with yaml_content) and POST /contracts/import.
    • An unknown name is an error that lists the names in the file.
  • Notes in API responses. The "ignored objects" note (now names the imported object and points at schema_object) is returned as notes in the JSON of POST /contracts/synth and POST /contracts/import. Omitted when empty, so existing clients see no change.
  • Composite primary key. Not enforced: engine uniqueness rules cover one field and are batch scoped, so a combination check needs an engine change. Each key column is already required. A note now says so.
  • relationships. No natural target in a contract that validates one object's events, so not mapped. A note says so.
  • Docs: docs/odcs/using-odcs-directly.md, field-mapping.md, synthetic-data-reference.md. OpenAPI updated for both endpoints.

Compatibility

Additive. New optional request fields and an optional response field. No migration. A DataContractGate export (lossless import) is a single contract; schema_object is noted as ignored there.

Tests

tests/odcs_schema_object.rs (7), one new synth handler test, one new odcs_compat test; the full-example test now expects the relationships note. cargo test, clippy and fmt are clean.

Skipped: composite uniqueness and relationship checks (engine work, out of scope).

… for composite key and relationships, notes in API responses
@vercel

vercel Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
contractgate Ready Ready Preview Nov 26, 2026 4:28pm UTC

Request Review

@nightmoose
nightmoose merged commit bc71ead into staging Nov 26, 2026
26 checks passed

This branch was successfully deployed

1 active deployment
Preview — a56ed66d Deployed Nov 26, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant