additionalProperties: false and anyOf/allOf #821
-
When validating against For example Value: key: value Schema: type: object
properties: []
additionalProperties: false
allOf:
- properties:
- key
type: string Is the property "key" valid in this object? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi @rafalkrupinski , In your example, it should not. For example:
|
Beta Was this translation helpful? Give feedback.
Hi @rafalkrupinski ,
In your example, it should not.
additionalProperties
only considers aproperties
keyword that is a direct sibling of it, ignoring any other one. However, in 2019-09 and later, we introducedunevaluatedProperties
(https://www.learnjsonschema.com/2020-12/unevaluated/unevaluatedproperties/) for that specific reason: it can look at adjacentproperties
that are not direct siblings.For example: