ajv-compiler
ajv-compiler copied to clipboard
breaking: JSON Schema draft-2020-12
Evaluate if the next major version should set the JSON schema draft-2020-12 as default
Ref: https://github.com/fastify/fastify/issues/4549 AJV docs: https://ajv.js.org/guide/schema-language.html#draft-2019-09-and-draft-2020-12
The AJV docs recommend sticking with 07 if you don't need the two new properties as all schemas will be affected by the reduced performance required to support them.
I'm not too much into it tbh - I think we can provide:
- an option to let the user switch the json version
- release a npm tagged version that is equal to
mainbut loads the other json schema standard - other ideas...
The AJV docs recommend sticking with
07if you don't need the two new properties as all schemas will be affected by the reduced performance required to support them.
Wow, I just discovered this:
Draft-2019-09 features performance cost (even when not used)
+1 for keeping 07 the default and letting the user choose
Somewhat related, is there a way to opt into the 2019 or 2020 version without having to re-implement a ValidatorCompiler? (Like opt into the defaults, but with a few more of the keywords).
If you register 2019, and add the 07 spec, can you pick which one you use with the $schema field?