This is the place to share and discuss new xarf schemas. The schemas are written in json schema and use its extension mechanisms to allow sharing common sub schemas.
Find the latest schema release on the releases page.
xarf_bundled_<VERSION>.schema.json
- all schema definitions in one file
- contains only internal references
- small file size
- best for most use cases, when the used tool is good enough to understand complex internal references (multiple hops)
xarf_deref_<VERSION>.schema.json
- all schema definitions in one file
- contains no references
- pretty big file size
- can be useful for some not-so-sophisticated code generation tools that can't handle references
npm install -g jsonfile json-schema-ref-parser ajv-cli
ajv -s xarf.schema.json -d "samples/*.json" -r "schemas/*.schema.json"
File(s) | Content |
---|---|
xarf.schema.json | contains links to all specific schemas |
schemas/xarf_shared.schema.json | reusable sub schemas |
schemas/*.schema.json | specific schemas |
samples/*.json | example documents for the schemas |
create_full_schema_file.js | allows combining the schema into a single file |
- Add a new schema as [subtype].schema.json and try to reuse as much as possible from xarf_shared.schema.json
- Add an example sample to samples/*
- Add the new schema to the list in xarf.schema.json
- Discuss and improve
Use create_full_schema_file.js to create a single file schema.
npm install jsonfile json-schema-ref-parser
node create_full_schema_file.js
It will generate two files:
File | Content |
---|---|
xarf_bundled.schema.json | bundled and minimized using internal refs, might not work with all json schema tools |
xarf_deref.schema.json | bundled and completely derefed. might be bigger in size, but should work with all tools |