Skip to content

Preserve keys, but fix potential JSON pointers to reflect actual DOM… #125

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

Merged
merged 2 commits into from
Mar 6, 2022
Merged

Preserve keys, but fix potential JSON pointers to reflect actual DOM… #125

merged 2 commits into from
Mar 6, 2022

Conversation

mrutkows
Copy link
Contributor

This PR seeks to suggest what could be least-invasive fix for the duplicate $id issue as described in #123.

It preserves all $id tags in case they were being used to reference schema objects from external schemas, but simply fixes those $id whose value (URI fragments), if used as JSON pointers (into the JSON schema document) did not match the actual object hierarchy of the actual document object model (DOM).

@jkowalleck
Copy link
Member

@mrutkows
are there no fixes needed in spec 1.2 JSON schema files?
are there no fixes needed in the strict JSON schema files?

@mrutkows
Copy link
Contributor Author

@jkowalleck Hi Jan, if you wish I can carry these changes over to the "Strict" version of 1.3 and had not thought to propagate the changes backwards to 1.2, but can if you wish.

@jkowalleck
Copy link
Member

@mrutkows i was asking more to get an answer whether the other files need to be also modified, if we would go with the proposed solution of this very PullRequest.

I think we need to be aware that this PR is a draft, not a final solution.
Nevertheless, the current state of this PR is enough to understand the impact and expected outcome.

@mrutkows
Copy link
Contributor Author

@jkowalleck of course, the "strict" version of 1.3 should have the changes as well... as for 1.2 that is a community decision as to how they want to support past releases (as I have not even looked into the 1.2 schema). If the problem exists there, I would be inclined to fix it there as well.

@mrutkows
Copy link
Contributor Author

mrutkows commented Jan 24, 2022

@jkowalleck committed a propagation of these proposed $id fixes to 1.3-strict, 1.2 and 1.2-strict json schema files. Please note that the 1.2 schemas only produced 2 of the 3 errors (because there was no "collision" for the "hashes" $id) this was due to v1.2 the "externalReference" object did not contain that "hashes" property; however the "tool" object still had "hashes" with the incorrect $id. Therefore I also fixed carried over the corresponding 1.3 change to include the proper relative (JSON pointer, fragment) path still applied (in case the 1.2 version ever adds "hashes" to other objects in the future).

Verified all schema errors for 1.3, 1.3-strict, 1.2 and 1.2-strict were fixed with these changes within https://www.liquid-technologies.com/online-json-schema-validator

@jkowalleck
Copy link
Member

thanks a lot, @mrutkows

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

Successfully merging this pull request may close these issues.

3 participants