I'm trying to validate a JSON input using json-schema but it does not work like I need it to.
I have the following input JSON (part of it):
[
{
"admin_state": "disabled"
},
{
"state": "disabled"
}
]
And the following json-schema (part of it as well):
{
"type": "array",
"items": [
{
"type": "object",
"properties": {
"admin_state": {
"type": "string",
"default": "enabled",
"enum": [
"disabled",
"enabled"
]
}
},
"additionalProperties": false
}
],
"minItems": 1
}
I want the validation to fail because of the "state" property that should not be allowed (thanks to the "additionalProperties": false option)
However, I can add/change anything in the second item in the array, validation is always successful. When I change anything in the first item, validation fails (as expected).
What did I miss?
Thanks for your help!