-
-
Notifications
You must be signed in to change notification settings - Fork 292
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
Allow empty "required" array #69
Comments
I don't think it is a problem. Being able to express the same thing in multiple ways (an explicit and an implicit notation) is not a goal of the specification. |
Then why is there an Put another way, the default value of |
That should be a different proposal. |
I was pointing out the inconsistency in claiming that JSON Schema is good about preventing multiple ways of expressing the same thing, not seriously suggesting requiring |
I would personally try to leave out a keyword if it's not going to have any effect on validation (since keywords generally add constraints to an instance), but not being overly pedantic about these sorts of things seems pretty reasonable. There might be a good reason to want to leave in a keyword even if it's not going to do anything. |
I agree with @awwright about trying to leave it out, but as long as I think mostly we allow putting in the default explicitly, so |
If it says in the spec, that if |
No objection here to allowing |
This addresses the enhancement requested in issue json-schema-org#69.
This addresses the enhancement requested in issue json-schema-org#69.
Er, as I mentioned in #112, it turns out "dependencies" has this behavior too. I'd like to just modify "stringArray" so both "dependencies" properties and "required" allows multiple items. They're both used for the same purpose, we should probably modify this behavior together. |
This addresses the enhancement requested in issue json-schema-org#69. The "requirements" and "dependencies" string arrays should be allowed to be empty, with the same effect as not being present.
@gibson042 with #112 now merged (thanks, @awwright !) I think this is now fixed. If you agree could you please close? |
In parallel with other keywords in I-D (minLength, etc.), it can be said that |
Good point, I'll reopen this briefly so I don't forget |
Addressed in #171 |
(copied from json-schema/json-schema#232 )
Draft v4 specifies that a
required
array "MUST have at least one element", which makes it impossible to explicitly indicate that all properties are optional (and therefore also impossible to distinguish intentional optionality from accidental omission ofrequired
). Empty values ("required": []
) should be permitted.The text was updated successfully, but these errors were encountered: