-
-
Notifications
You must be signed in to change notification settings - Fork 309
unevaluatedProperties and unevaluatedItems should probably consider const
and enum
#956
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
Comments
@ChALkeR This is similar to how the following also fails: {
anyOf: [
{ required: [ foo ] },
{ properties: { x: { type: 'string' } } }
],
unevaluatedProperties: false
} JSON Schema separates assertions about properties (or array items) from applicator keywords that describe what properties (or items) may or may not be present. For now we have made the decisions that {
const: { foo: 30 } },
additionalProperties: false
} will also fail on I agree it's weird and somewhat arbitrary, but it is the only way we could stay consistent with existing behavior. The solution is to simply do: {
anyOf: [
{ const: { foo: 30 } },
{ properties: {
foo: true,
x: { type: 'string' }
} }
],
unevaluatedProperties: false
} This is different from #810 , because |
Thinking about how |
@karenetheridge yeah I admit I'm skeptical of expanding the behavior here. See also #846 about Although I rather expect all of these would be better as extension vocabularies since, by definition, they are not needed in terms of functionality, only convenience. But convenience on very large schemas can be a big deal! |
@ChALkeR Would you also argue that you would expect |
/remind me to close this issue if there's no reply in 14 days |
@Relequestual set a reminder for Aug 8th 2020 |
👋 @Relequestual, close this issue if there's no reply |
Closing due to no reply. |
E.g.:
currently must fail per spec on
{ foo: 30 }
, which doesn't seem to make sense.Related: #810
The text was updated successfully, but these errors were encountered: