You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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.
Dominik Kowalski (@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.
Dominik Kowalski (@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.
Ilya (@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.
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.
Activity
gregsdennis commentedon Sep 1, 2022
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 commentedon Sep 2, 2022
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 commentedon Sep 2, 2022
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 commentedon Sep 2, 2022
Only search
https://github.com/PowerShell/PowerShell/issues?q=is%3Aissue+is%3Aopen+%22Test-Json%22+label%3AWG-Cmdlets-Utility
dkaszews commentedon 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 commentedon Sep 2, 2022
Hint: adding "in:title" to search usually yields much better results.
gregsdennis commentedon Sep 2, 2022
Dominik Kowalski (@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 commentedon Sep 3, 2022
Greg Dennis (@gregsdennis) If you're member of the JSON Schema team and provide reference implementations then that is completely different case 🙂
iSazonov commentedon Sep 3, 2022
Dominik Kowalski (@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 commentedon Sep 3, 2022
Ilya (@iSazonov) Thanks for explanation, I was not aware of this. From what I saw,
Test-Jsoncan be easily migrated as it pretty much just forwards strings or filenames for JSON and its schema. Other cmdlets might be more difficult, butTest-Jsonis 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 commentedon Sep 3, 2022
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.