Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[node-core-library] Add support json-schema 'draft-07' validation in JsonFile / JsonSchema #4713

Closed
bartvandenende-wm opened this issue May 15, 2024 · 2 comments · Fixed by #4714

Comments

@bartvandenende-wm
Copy link
Contributor

Summary

[node-core-library] Add support json-schema 'draft-07' validation in JsonFile / JsonSchema

Details

JsonFile and the related JsonSchema in the @rushstack/node-core-library library make use of z-schema which does not have proper support of newer json-schema standards. Json-schema draft-07 was published in 2018 and draft-04 is slowly being replaced with draft-07 in the community.

It would be great if the rushstack is able to support draft-07 json schema in addition to draft-04 to ensure backwards compatibility (specifically as most of rush its own definitions are using draft-04)

Standard questions

Please answer these questions to help us investigate your issue more quickly:

Question Answer
Package name: @rushstack/node-core-library
Package version? 4.3.0
Operating system? Mac
Would you consider contributing a PR? yes
Node.js version (node -v)? v18.16.1
@iclanton
Copy link
Member

Would it make sense to also add support for the latest non-draft version (2020-12)?

We could consider making this a breaking change and publishing a new major version of @rushstack/node-core-library.

@bartvandenende-wm
Copy link
Contributor Author

I created a PR to support this ticket which migrates the underlying validator in JsonSchema from z-schema to avj which already supports the 2020 spec (opt-in).

Unfortunately vscode does not support it yet so it throws an ugly warning per microsoft/vscode#165219. It should be pretty trivial though to add it if we wanted, but given the above I focussed in the linked PR only on draft-07 while keeping backwards compatibility with draft-04.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Closed
Development

Successfully merging a pull request may close this issue.

2 participants