-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
The value of the examples annotation should be an object or an array #48
Comments
Another option would be to add a |
Now that dependencies has split into dependentRequired and dependentSchemas, and items into prefixItems and items, do we have any polytyped keywords remaining? ..other than examples and const, which can be any type at all... |
This isn't an issue in my .net implementation. I just save the JSON model which can represent the appropriate types. |
@karenetheridge The rationale for splitting |
(idk why I felt compelled to go all history lesson on |
We expect nothing less from you @handrews. |
@handrews |
In 2020-12, we changed the behavior of unknown keywords to be included as annotations rather than being ignored. This means that you can add There's no need to explicitly defined the keyword. |
I agree with @gregsdennis, a new keyword is not necessary, however I could see this keyword as part of a vocabulary of keywords that support mock servers or something similar. |
I'm going to move this over to the vocabularies repo. As noted, there is no longer a need to add a new keyword to the specification get the basic annotation behavior, but a vocabulary that defines this would be useful for interoperability. As explained in PR json-schema-org/json-schema-spec#1294, implementations should be able to trivially support annotation-only vocabularies when they are included as optional ( |
Json schema has examples annotation, which comes handy, when I would like to run a mock server for my api.
Unfortunately the spec states, that the value of
examples
keyword MUST be an array:I suggest to enable objects as well, so each example could be referenced by name:
This change could make the construction of complex examples ( like a list ) much simpler.
The text was updated successfully, but these errors were encountered: