Skip to content

fix(schema): rename v1 to v1.0, add umbrella + READMEs + self-contain…#9

Open
ameetdesh wants to merge 1 commit into
beckn:mainfrom
ameetdesh:fix/schema-publish-errors
Open

fix(schema): rename v1 to v1.0, add umbrella + READMEs + self-contain…#9
ameetdesh wants to merge 1 commit into
beckn:mainfrom
ameetdesh:fix/schema-publish-errors

Conversation

@ameetdesh

Copy link
Copy Markdown
Contributor

…ed schema.json

Brings the schema/ tree into compliance with the schema.beckn.io publisher checks. Fixes 8 errors:

  • missing-root-context → adds schema/context.jsonld
  • missing-root-vocab → adds schema/vocab.jsonld
  • missing-class-readme → adds DatasetItem/README.md, DatasetFulfillment/README.md
  • invalid-version-name x2 → renames DatasetItem/v1 → v1.0 and DatasetFulfillment/v1 → v1.0
  • missing-readme x2 → adds DatasetItem/v1.0/README.md, DatasetFulfillment/v1.0/README.md

Beyond the publisher errors, this also rationalises the JSON-LD layout for SSOT so cross-version concerns live in one place:

schema/context.jsonld namespace prefixes (dataset:, fulfillment:)
+ class IRI mappings (DatasetItem, DatasetFulfillment)
schema/vocab.jsonld rdfs:Class declarations for both classes

/v1.0/context.jsonld inherits root via @context: [, {properties}]
— declares only v1.0 property mappings
/v1.0/vocab.jsonld declares only v1.0 rdf:Property nodes
(no rdfs:Class — that's in root)
/v1.1/context.jsonld inherits v1.0 via @context: [<v1.0 URL>, {new properties}]
— declares only v1.1-new property mappings
/v1.1/vocab.jsonld declares only v1.1-new rdf:Property nodes

Adds a self-contained JSON Schema (draft 2020-12) per version so runtime validators don't need to dereference any external $ref:

/v1.0/schema.json
/v1.1/schema.json

Self-contained means schema.json inlines all property definitions (intentionally duplicating across v1.0 and v1.1) — JSON Schema's allOf semantics (intersection on enums) make safe schema inheritance impossible for v1.1's extended accessMethod enum, so each version gets its own full schema. The SSOT in context/vocab is sufficient for the JSON-LD layer; the JSON Schema layer trades duplication for hermetic per-version validation.

URLs in @context arrays use https://schema.beckn.io/... as the canonical publish target.

Out of scope (would break other PRs):
example/v1/ and testnet/rain-probability-devkit/ still reference
raw.githubusercontent.com/.../v1/ URLs. These need a follow-up
pass after this PR merges and the v1.0 paths are live.

…ed schema.json

Brings the schema/ tree into compliance with the schema.beckn.io
publisher checks. Fixes 8 errors:
  - missing-root-context     → adds schema/context.jsonld
  - missing-root-vocab       → adds schema/vocab.jsonld
  - missing-class-readme     → adds DatasetItem/README.md, DatasetFulfillment/README.md
  - invalid-version-name x2  → renames DatasetItem/v1 → v1.0 and DatasetFulfillment/v1 → v1.0
  - missing-readme x2        → adds DatasetItem/v1.0/README.md, DatasetFulfillment/v1.0/README.md

Beyond the publisher errors, this also rationalises the JSON-LD layout
for SSOT so cross-version concerns live in one place:

  schema/context.jsonld     namespace prefixes (dataset:, fulfillment:)
                            + class IRI mappings (DatasetItem, DatasetFulfillment)
  schema/vocab.jsonld       rdfs:Class declarations for both classes

  <Class>/v1.0/context.jsonld   inherits root via @context: [<root URL>, {properties}]
                                — declares only v1.0 property mappings
  <Class>/v1.0/vocab.jsonld     declares only v1.0 rdf:Property nodes
                                (no rdfs:Class — that's in root)
  <Class>/v1.1/context.jsonld   inherits v1.0 via @context: [<v1.0 URL>, {new properties}]
                                — declares only v1.1-new property mappings
  <Class>/v1.1/vocab.jsonld     declares only v1.1-new rdf:Property nodes

Adds a self-contained JSON Schema (draft 2020-12) per version so
runtime validators don't need to dereference any external $ref:

  <Class>/v1.0/schema.json
  <Class>/v1.1/schema.json

Self-contained means schema.json inlines all property definitions
(intentionally duplicating across v1.0 and v1.1) — JSON Schema's
allOf semantics (intersection on enums) make safe schema inheritance
impossible for v1.1's extended accessMethod enum, so each version
gets its own full schema. The SSOT in context/vocab is sufficient
for the JSON-LD layer; the JSON Schema layer trades duplication
for hermetic per-version validation.

URLs in @context arrays use https://schema.beckn.io/... as the
canonical publish target.

Out of scope (would break other PRs):
  example/v1/ and testnet/rain-probability-devkit/ still reference
  raw.githubusercontent.com/.../v1/ URLs. These need a follow-up
  pass after this PR merges and the v1.0 paths are live.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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