Open
Description
Default values of sub-schema are not taken into account when a conditional schema is validated.
For instance , an empty JSON document must be validated against the follow JSON schema:
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"default": {},
"properties": {
"condition": {
"type": "boolean",
"default": false
},
"data": {
"type": "string"
}
},
"if": {
"properties": { "condition": { "const": true } }
},
"then": {
"required": ["data"]
}
}
The property condition
is not defined in document to validate but its default value should be used to test the if
condition.
The current implementation of json-schema-validator
throws an exception of type std::invalid_argument
: At of {} - required property 'data' not found in object