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

Add $schema keywords to actual schemas #557

Closed
jviotti opened this issue Jun 17, 2022 · 2 comments
Closed

Add $schema keywords to actual schemas #557

jviotti opened this issue Jun 17, 2022 · 2 comments

Comments

@jviotti
Copy link
Member

jviotti commented Jun 17, 2022

According to the specification, JSON Schema definitions are recommended to have a $schema keyword. Instead of relying on implementors to guess which one should be used for every folder, would it make sense to manually set $schema in all the tests?

This would also open the door for better testing vocabularies, where you have tests with certain meta-schemas that define or not define certain vocabularies.

@jviotti
Copy link
Member Author

jviotti commented Jun 17, 2022

This might better allow expressing some optional tests like format depending on whether format-assertion or format-annotation is used?

@Julian
Copy link
Member

Julian commented Jun 17, 2022

This is a duplicate of #311 -- can you express your support there instead? I'm going to reiterate what I write below there too as my opinion and we can see what others think.

To me, I don't feel the recommendation really applies strongly here, for reasons I intended to describe in #324 -- namely, what I think we should optimize for in the test suite is readability, not perfection -- and while that recommendation is perfect for schemas in isolation which otherwise wouldn't know what $schema they belong to, for the test suite, it seems more to be boilerplate that makes it harder to focus on the key point of each test case. So I've always been -0 on adding it.

On the other hand I do like:

Instead of relying on implementors to guess which one should be used for every folder, would it make sense to manually set $schema in all the tests

since it seems nice to be able to rely on something someone already needs to support, but I don't think, again in my opinion, that this will work really. Because the test suite will always need to also include a test where $schema is not present (as we always do for SHOULDs in the spec which may be ignored), and once we need to do so, the problem comes back again.

But yeah happy to either elaborate myself, or hear again from others. I know Greg and Henry may still be in favor of this.

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

No branches or pull requests

2 participants