-
-
Notifications
You must be signed in to change notification settings - Fork 207
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
Declare "format" assertion test cases in a way that plays more nicely with vocabularies #513
Comments
That is the intention, but no one has gotten around to doing it yet :) Do however note that implementing the format-assertion vocabulary is still optional, so the tests would need to remain where they are regardless. |
We probably need to break tests down into vocabulary folders, which also contain optional tests per vocabulary. |
I'm wondering if there are two levels of "optionality" that we are discussing together. Whether a vocabulary is optional or not depends on how the schema-writer declares On the other hand, there seems to be an implicit definition of what vocabularies are required to be supported by an implementation with a certain degree of maturity, and In my opinion, the "optional" directory makes sense for test cases that i.e. cannot be implemented in some programming languages (like some floating-point related tests that are not satisfiable on JavaScript), but it feels to me that according to the spec, only the Core vocabulary is strictly required and the rest are all within the same category of required-ness (including Am I thinking in the right direction? |
Ha, you're right. The term "optional" is far too overloaded.
Not quite. If you create a custom JSON Schema dialect, the core and applicator vocabularies are required to be implemented (although it really should just be core). If you are implementing the standard JSON Schema dialect, you are required to implement all the vocabularies listed in the dialect meta-schema. That doesn't include Using a custom dialect meta-schema that includes the So, |
Closing this in favor of #495 which is very similar ("what layout better supports vocabularies and format in particular"). Further thoughts obviously still welcome. |
The test suite currently distinguishes between the assertion and annotation format vocabularies by putting the assertion format test cases inside the
optional
subdirectory: https://github.com/json-schema-org/JSON-Schema-Test-Suite/tree/master/tests/draft2020-12/optional/format.However, this setup doesn't play nicely with the concept of vocabularies as it treats this difference as an exceptional case to be handled by the JSON Schema implementor. I think that a more natural way to express this would be the following:
$vocabulary
to set the format assertion vocabulary instead of its annotation counterpartformat
to use such meta-schema and the test cases that treatformat
as an annotation to use the "official" meta-schema that uses the annotation vocabularyformat
test cases out ofoptional
This change forces implementors to understand
$vocabulary
and implement the right semantics accordingly and be closer with the specification rather than just saying that "format" is optional.The text was updated successfully, but these errors were encountered: