-
-
Notifications
You must be signed in to change notification settings - Fork 69
Closed
Description
Using the following schema:
{
"$schema": "http://json-schema.org/draft-07/schema",
"properties": {
"elements": {
"type": "array",
"items": {
"type": "object"
},
"contains": {
"properties": {
"somePropertyA": {
"type": "string",
"enum": [
"true"
]
}
}
}
}
}
}
the following object is considered valid
{
"elements": [
{
"somePropertyB": "false"
},
{
"somePropertyA": "false"
}
]
}
despite the schema saying "elements should contain a "somePropertyA":"true" object.
Is this the normal behaviour? most validators I tried will consider it valid (despite being intended not to be valid). The only way to make this work is passing an array with just the "intended" property, like
{
"elements": [
{
"somePropertyA": "false"
}
]
}
this will correctly be considered invalid.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels