additionalProperties: false and anyOf/allOf #821
-
|
When validating against For example Value: key: valueSchema: type: object
properties: []
additionalProperties: false
allOf:
- properties:
- key
type: stringIs 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.
additionalPropertiesonly considers apropertieskeyword 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 adjacentpropertiesthat are not direct siblings.For example: