Beckn Schema and Protocol Architecture Consolidation — Work in Progress #94
ravi-prakash-v
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
What this is
This thread documents an active, in-progress consolidation of the Beckn Protocol schema and API architecture. The work spans
beckn/core_schema,beckn/protocol-specifications-v2, andbeckn-one/schema.beckn.io. It started as a schema review (Issue #1 incore_schema, raised by @anandp504) and has grown into a comprehensive architectural redesign.Work proceeds on feature branches and draft RFCs. No approval is needed to start — if design changes are required after discussion, we adjust on the branch. Please raise questions or concerns here or in the relevant issues.
Why this matters
The Beckn network is going to grow substantially. We already have BAP, BPP, Registry, and Catalog Discovery/Publishing Services. Coming soon: Issue and Grievance Management Service, Reconciliation and Settlement Service, Reputation Management Service, Credentialing Service, Observability and Insight Engine, Transaction Ledger, and potentially AI Agents. Each new actor needs to speak Beckn. The current architecture does not make that easy — the protocol spec is entangled with action definitions, schemas are scattered across repos, and the schema registry doesn't support federation.
We are fixing this now, while the v2 spec is still being consolidated, not after.
Design philosophy (the short version)
Four guiding philosophies:
Two derived principles:
beckn.yamlhas a very long half-life (like HTTP). New actors and endpoints don't require commits toprotocol-specifications-v2.schemas(formerlycore_schema) without touching the protocol spec.Full document:
docs/design-philosophy.md| Tracking issue: #93The target architecture
schema.beckn.iois a namespace router — domain owners can keep schemas in their own repos and register a namespace prefix.schema-admin.beckn.iois a staging/validation pipeline before publish.Implementers need exactly three imports:
beckn.yamlcontext.jsonldvocab.jsonldEverything else resolves automatically via
$ref.What is broken right now
RequestActionandCallbackActionincore_schemahaveoneOfnested insideproperties— structurally invalid JSON Schema, they don't validate anythingContextis duplicated betweencore_schemaandbeckn.yamlwith divergent contentBecknEndpointonly exists inline inbeckn.yaml— can't be referenced from schemasDiscoverAction,SelectAction, etc.) are incore_schemabut not referenced bybeckn.yaml— orphanedcore_schema/Contextreferenceshttps://schema.beckn.io/Action/v2.0which does not existWhat is already fixed (Issues #2–#7 in
core_schema)beckn:namespace URI corrected$refURIs standardised to versioned canonical formtype:objectreplaced withallOf $refProvider @contextURL andFulfillmentStage @typebugs fixedadditionalProperties: falseadded to 25 schemasschema:prefix removed from property keys;@typedefaults fixedPhased execution plan
Phase 0 — Design record ✅ Done
docs/design-philosophy.mdpublished toprotocol-specifications-v2(branchdocs/design-philosophy-rfc)Phase 1 — Stakeholder communication ✅ In progress (this thread)
Phase 2 — All issues filed (next)
Issues will be created in
core_schema,protocol-specifications-v2, andbeckn-one/schema.beckn.iocovering: BecknAction implementation, schema-admin pipeline, folder structure investigation, federated registry manifest, domain migration (opt-in), repo rename, deprecation of RequestAction/CallbackAction, compatibility testing, example generation framework.Phase 3 — Issue #8 code
Create
BecknEndpoint,Message, fixContext, createBecknAction. PR →schema-fixesincore_schema.Phase 4 — Slim down
beckn.yamlRemove inline
Context/BecknEndpoint/Message. Wire two$reftouch points. PR →maininprotocol-specifications-v2.Phase 5 — Validation and testing
Schema compatibility checks, vocabulary compatibility, use case stress testing (retail, mobility, logistics, energy), design principles adherence audit.
Phase 6 — Structural migration (gated on Phase 5)
Folder rename (
schema/→data/), namespace routing manifest, schema-admin pipeline, optional domain schema migrations, repo rename (core_schema→schemas).Phase 7 — Example generation framework
Retail use case examples for all 10 action pairs. Discovery/catalog examples against the active runtime service. Disclaimer: if API design changes post-discussion, examples are regenerated (framework, not manual).
Who is affected and how
beckn.yamlchanges in Phase 4beckn/DEG; federated registry design ensures they're served viaschema.beckn.ionamespace routing; schema-admin pipeline for external schema ingestionbeckn.yamlupdate (Phase 4), repo rename (Phase 6), example generation (Phase 7), use case stress testing (Phase 5)schema.beckn.ionamespace routing makes domain schemas discoverableComplex interdependencies to be aware of
Questions and concerns welcome here. @abhimail @ameetdesh @nirmay @bachia @anandp504 @pramodkvarma
Beta Was this translation helpful? Give feedback.
All reactions