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

Supporting later versions of JSON Schema #18009

Closed
gregsdennis opened this issue Sep 1, 2022 · 12 comments · Fixed by #18141
Closed

Supporting later versions of JSON Schema #18009

gregsdennis opened this issue Sep 1, 2022 · 12 comments · Fixed by #18141
Labels
Issue-Enhancement the issue is more of a feature request than a bug Resolution-Fixed The issue is fixed.

Comments

@gregsdennis
Copy link
Contributor

Summary of the new feature / enhancement

Hello! I'm on the JSON Schema specification team, and I was wondering what drafts are currently supported. I can see by and example in the docs that draft 7 is supported, but this is now several years old, and two newer versions have been released.

Happy to help if needed!

Proposed technical implementation details (optional)

No response

@gregsdennis gregsdennis added Issue-Enhancement the issue is more of a feature request than a bug Needs-Triage The issue is new and needs to be triaged by a work group. labels Sep 1, 2022
@gregsdennis
Copy link
Contributor Author

It also looks like you're using NJsonSchema (backed by Newtonsoft) to support this. If there's any interest in using System.Text.Json, I'd like to offer my validator JsonSchema.Net as an alternative. It already supports all the latest drafts and I regularly update it.

@iSazonov
Copy link
Collaborator

iSazonov commented Sep 2, 2022

If there's any interest in using System.Text.Json

No doubt we would like to migrate to this new API all Json cmdlets in the repository.

If you want you can pull PR to update Test-Json cmdlet. We have some issues opened for Test-Json and if they were fixed, that would be great.

@gregsdennis
Copy link
Contributor Author

Is there a label for this cmdlet that I can use to search for the issues? I couldn't see one, but there are over 100 labels, so...

@iSazonov
Copy link
Collaborator

iSazonov commented Sep 2, 2022

Only search
https://github.com/PowerShell/PowerShell/issues?q=is%3Aissue+is%3Aopen+%22Test-Json%22+label%3AWG-Cmdlets-Utility

GitHub
PowerShell for every system! Contribute to PowerShell/PowerShell development by creating an account on GitHub.

@dkaszews
Copy link
Contributor

dkaszews commented Sep 2, 2022

Migrating to a different provider just because it currently has more up to date features seems like fools errand - a lot of effort, and later may turn out that yet another one (including our original one) is now updated faster.

It's better to ask our current provider to support newer versions of the schema, and once they do we can just bump the library version. If they are open source, you can open a PR yourself.

@dkaszews
Copy link
Contributor

dkaszews commented Sep 2, 2022

Only search https://github.com/PowerShell/PowerShell/issues?q=is%3Aissue+is%3Aopen+%22Test-Json%22+label%3AWG-Cmdlets-Utility

GitHub**Issues · PowerShell/PowerShell**PowerShell for every system! Contribute to PowerShell/PowerShell development by creating an account on GitHub.

Hint: adding "in:title" to search usually yields much better results.

GitHub
PowerShell for every system! Contribute to PowerShell/PowerShell development by creating an account on GitHub.

@gregsdennis
Copy link
Contributor Author

@dkaszews I am proposing to use my own validator, and I'm fine with doing the work to move over.

I'm also a member of the JSON Schema core team (as a co-author of the spec), and I'm employed specifically to work with tooling providers, like PowerShell.

I keep my implementation up to date, and I actively develop new features (on an unpublished branch) as we're adding them to the next version of the spec as a platform for viability. As a result of all of this, my implementation has been the first to publish new JSON Schema features for the past two iterations (at least).

I've had conversations with the owner of NJsonSchema, and while there is an effort to move over, it's been quite slow. I believe my last contact with them was almost a year ago, with no progress for the library in that direction during that time.

@dkaszews
Copy link
Contributor

dkaszews commented Sep 3, 2022

@gregsdennis If you're member of the JSON Schema team and provide reference implementations then that is completely different case 🙂

@iSazonov
Copy link
Collaborator

iSazonov commented Sep 3, 2022

@dkaszews Key here is that NJsonSchema backed by Newtonsoft and JsonSchema.Net is on System.Text.Json - modern implementation (NJsonSchema is frozen project - no new feature, only bug fixes). It is right way for PowerSHell to migrate from NewtonSoft to System.Text.Json.

@dkaszews
Copy link
Contributor

dkaszews commented Sep 3, 2022

@iSazonov Thanks for explanation, I was not aware of this. From what I saw, Test-Json can be easily migrated as it pretty much just forwards strings or filenames for JSON and its schema. Other cmdlets might be more difficult, but Test-Json is the only one that uses JSON schema and returns just true or false, so I see no downside in swapping to a better provider immediately.

@iSazonov
Copy link
Collaborator

iSazonov commented Sep 3, 2022

Other cmdlets might be more difficult

Yes, I pulled two PR (for Test-Json and ConvertTo-Json) but closed them recently (no progress in review). It is impossible to migrate without breaking changes. But the migration is inevitable at some point.

gregsdennis added a commit to gregsdennis/PowerShell that referenced this issue Sep 3, 2022
@ghost ghost added the In-PR Indicates that a PR is out for the issue label Sep 3, 2022
@ghost ghost removed the In-PR Indicates that a PR is out for the issue label Sep 21, 2022
@ghost ghost added the In-PR Indicates that a PR is out for the issue label Sep 21, 2022
@ghost ghost added Resolution-Fixed The issue is fixed. and removed In-PR Indicates that a PR is out for the issue Needs-Triage The issue is new and needs to be triaged by a work group. labels May 4, 2023
@ghost
Copy link

ghost commented Jun 29, 2023

🎉This issue was addressed in #18141, which has now been successfully released as v7.4.0-preview.4.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Enhancement the issue is more of a feature request than a bug Resolution-Fixed The issue is fixed.
Projects
None yet
3 participants