hyperjump-io / json-schema-bundle

A tool for bundling JSON Schema documents
MIT License
14 stars 1 forks source link

Should meta schemas be bundled? #7

Open jonaslagoni opened 2 years ago

jonaslagoni commented 2 years ago

We had some problems bundling the Draft 7 JSON Schema document in our compound JSON Schema document for AsyncAPI. One discussion that came up is, should the meta schema be bundled together when used? 🤔

Maybe it's already decided, but I just need to keep track of the issue and discussion, feel free to close if it's no longer relevant.

Slack discussion: https://json-schema.slack.com/archives/C5CF75URH/p1648137451821299

jdesrosiers commented 2 years ago

Anything that's referenced with $ref will be bundled by default even if it's a meta-schema. You can set any schema to be excluded from the bundle using the externalSchemas option on the "bundle" function. See the README for more details.

It would probably be a good idea for me to automatically exclude anything known to be a meta-schema, but for now, it's a manual process.