Repository navigation
ci: validate schema packs and examples; port the examples to v2 - #15
Merged
Merged
Conversation
Add tools/validate.py and a workflow that runs it on every pull request: - packs: required files, JSON Schema 2020-12 validity, every $ref resolving inside the repository, attributes.yaml and schema.json describing the same type, titles, README reference rows, an instance built from each schema's own examples, and pairwise composition of the protected JSON-LD contexts. - examples: every JSON block under docs/example_implementations, the message against the core beckn.yaml action schema and each typed logistics object against its pack, including properties the pack does not define. Rewrite the hyperlocal guide's payloads so they pass, and port the courier, interstate, long-haul and express examples from the v1 message shape to v2. Each page lists what the packs cannot express yet. Co-Authored-By: Claude <noreply@anthropic.com>
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
Adds CI for this repository and makes every example payload valid.
Until now nothing checked the schema packs or the examples. The six typed objects in the hyperlocal guide did not validate against the packs, its messages did not match the core
beckn.yamlshapes, and the courier, interstate, long-haul and express pages were still in the v1 message shape (search,order,fulfillment,tags).What is added
tools/validate.py, run by.github/workflows/validate.ymlon every pull request and onmain.python tools/validate.py packschecks, for every pack:schema.jsonagainst the JSON Schema 2020-12 meta-schema;$refresolving to a file and fragment inside this repository;attributes.yamlandschema.jsondescribing the same type, at every depth;attributes.yaml;python tools/validate.py exampleschecks every JSON block underdocs/example_implementations:Contextand the message against the core action schema, frombeckn.yamlatprotocol-specifications-v2@a22300a;What changes in the docs
schema.nfh.global, and three open questions are added (the shape ofCommitment.resources[].quantity, offer-level service terms, and what discovery filters evaluate against).discover,on_discover,on_confirmandon_statusmessages (express also hason_updateandrate). Company names are replaced withexample.netidentifiers. Each page ends with a short list of what the packs cannot express yet.Slot usage introduced by the ports
The guide's mapping is followed. Two placements are new and worth a look:
Consignmentincommitments[].commitmentAttributes(courier, interstate, long haul).Carrierinprovider.providerAttributesat discovery.Verification
packs: 26 packs, 0 problems.examples: 26 messages and 50 typed objects, 0 problems.mainbefore this change,examplesreports 112 problems.Not in this PR
docs/1_Overview.mdtodocs/3_Semantic_Relationships_With_Beckn.md,docs/Logistics_Ontology.mdanddocs/API-Flows.mdstill describe the older ontology and v1 flows. They are outsidedocs/example_implementationsand are not validated yet.🤖 Generated with Claude Code