Add Schema as a top-level concept (beta) - #163
Draft
Fannon wants to merge 1 commit into
Draft
Conversation
|
Introduces a lightweight, reusable Schema resource that describes the
concrete structure of a data object (DTO, event payload, API request/
response model, or document/declarative-config contract like a k8s CRD;
ORD's own published JSON Schema is such an example).
Distinct from EntityType: EntityType is the conceptual domain model or
business term ('what it means'); Schema is the physical serialization
structure ('how it is shaped'). A Schema references the EntityType(s)
it represents via relatedEntityTypes (SchemaEntityTypeRelation:
{ordId, relationType}; direction Schema -> EntityType).
Modeled on Capability (lean): required set is ordId, title, version,
releaseStatus, visibility. partOfPackage is optional. Adds an optional
compatibility mode (none/backward/forward/full).
Relationships: ApiResource, EventResource, and Capability reference
Schemas via a uniform relatedSchemas list of RelatedSchema objects
({ordId, relationType}); relationType is an extensible Concept ID
(ord:exposes for schemas contained in an API contract, ord:payload for
an event payload schema).
SchemaDefinition.type is an extensible enum: global industry-standard
formats are bare consts (json-schema-v7, json-schema-v2020-12, avro-v1,
protobuf-v3, xsd-v1, sap-csn-interop-effective-v1), consistent with
existing openapi-v3/asyncapi-v2; other formats use a namespace-prefixed
Specification ID or custom+customType.
New definitions: Schema, SchemaDefinition, SchemaEntityTypeRelation,
RelatedSchema. Adds schemas[] to the Document root and 1.17 to the
version enum. Includes a concept doc page, a validating example, and a
CHANGELOG entry. Introduced as beta.
Fannon
force-pushed
the
feature/schema-concept
branch
from
July 31, 2026 07:21
48683d3 to
f5450bf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Introduces Schema as a new, lightweight top-level ORD concept (beta).
A Schema describes the concrete structure of a data object: a DTO, an event payload, an API request/response model, or the contract of a whole document / declarative-config object (e.g. a Kubernetes CRD — ORD's own published JSON Schema for ORD Documents is such an example).
This is deliberately distinct from
EntityType:The same EntityType can have several Schemas as physical representations, depending on API/protocol/format. A Schema references the EntityType(s) it represents (direction: Schema → EntityType) via
relatedEntityTypesas{ordId, relationType}objects (ord:represents/ord:partial-representation, extensible).Design decisions
Capability(lean). Required:ordId,title,version,releaseStatus,visibility.partOfPackageis optional (lighter than Capability).compatibilitymode (none/backward/forward/full), mirroring schema-registry semantics (Confluent, AWS Glue, CNCF xRegistry).SchemaDefinitionmirrorsCapabilityDefinition(type/mediaType/url/accessStrategies/visibility/purpose).typeis an extensible enum: global industry-standard formats are bare consts (json-schema-v7,json-schema-v2020-12,avro-v1,protobuf-v3,xsd-v1,sap-csn-interop-effective-v1), consistent with existingopenapi-v3/asyncapi-v2; anything else uses a namespace-prefixed Specification ID orcustom.relatedSchemas(notexposedSchemas) — resolved design decision. The first draft used anexposedSchemasobject on API/Event (mirroringexposedEntityTypes). We chose instead a single, uniformrelatedSchemasfield onApiResource,EventResource, andCapability, modeled as aRelatedSchemaobject{ordId, relationType}. Rationale:exposedSchemason some andrelatedSchemason others.relationType(extensible Concept ID), matching how the same EntityType can have different schemas per API/protocol. Seeded values:ord:exposes(schema contained in an API contract) andord:payload(event payload schema).Relationships
relatedSchemas(RelatedSchema={ordId, relationType}). An API contract typically relates many schemas (ord:exposes); an event references its payload schema (ord:payload).relatedSchemas' counterpart on the Schema side isrelatedEntityTypes(SchemaEntityTypeRelation), pointing to the concept it represents.Changes
Schema,SchemaDefinition,SchemaEntityTypeRelation,RelatedSchema.schemas[]array on the Document root (beta); added tox-property-order.relatedSchemasonApiResource,EventResource, andCapability(beta)."1.17"to theopenResourceDiscoveryversion enum.docs/spec-v1/concepts/schema.md), a validating example (examples/documents/document-schemas.json), and aCHANGELOGentry.Introduced as beta so the enum values and relationships can iterate before locking.
Open questions / for discussion
SchemavsDataSchema(potential confusion with "JSON Schema").compatibilityinclude transitive variants (backward-transitive, etc.)?SchemaDefinition.typeseed set — which formats do we standardize now? Do we keepprotobuf-v3, and what else belongs in the initial list? The big three across every major registry (Confluent, AWS Glue, Apicurio) are Avro, JSON Schema, and Protobuf — Protobuf is a first-class citizen everywhere, soprotobuf-v3looks warranted. Apicurio additionally handles OpenAPI, AsyncAPI, GraphQL, WSDL, and XSD. Sincetypeis an extensible enum (anything can be added later via a namespaced Specification ID orcustom), the question is which to seed as standardized bare consts vs leave to extension. Current seed:json-schema-v7,json-schema-v2020-12,avro-v1,protobuf-v3,xsd-v1,sap-csn-interop-effective-v1. Candidates to consider: newer JSON Schema drafts,graphql-sdl(already exists for API definitions). Also: is per-version granularity (protobuf-v3vs a singleprotobuf) the right approach?relationTypevalues (ord:exposes,ord:payload,ord:represents,ord:partial-representation).definitions(beta) so the same schema isn't described in both places.Verification
npm run lint,npm run test(16/16), andnpm run buildall pass. No broken links originate from the new pages.🤖 Generated with Claude Code