New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch to ajv/2020 for fastify 5 #5448
Comments
Draft 7 and Draft 2020-12 is great different. |
@climba03003 Do you mean that existing Draft 7 schemas will stop working under Draft 2020? |
Mostly, yes. If it can works, I don't see a reason why, https://json-schema.org/draft/2019-09/release-notes |
Draft-2020 is also marked as It would be nice but a lot of schemas uses mostly the 2019-draft, and doing this make them prone to break and cause friction with the adoption of Fastify v5. Might be better to allow them do it if they want or still use 2019's draft |
It's also important to note that, and this is what changed my mind on this, the AJV docs recommend sticking with 07 if we don't need the two new properties as all schemas will be affected by the reduced performance required to support them fastify/ajv-compiler#105 (comment) So it seems logical for me to keep the default 7 and let the user configure the setting |
Switching the ajv version is as easy as writing:
Since changing the default would be a massive breaking change for the user (as it should rewrite all its schemas) - we could just ship a new |
I think we would need fast-json-stringify to support it first. |
Prerequisites
馃殌 Feature Proposal
I wonder if we should consider switching to
ajv/dist/2020
during our next SemVer major.According to sinclairzx81/typebox#490 (comment), default ajv is still using Draft 7 version of JSON schema.
Motivation
Support latest additions to the JSON schema standard. Considering the scope and impact of this change, I doubt we can do this outside of a SemVer major.
Example
I don't expect usage patterns for ajv or ajv-compiler to change, it will simply allow to support the features introduced in later versions of JSON Schema.
The text was updated successfully, but these errors were encountered: