Closed
Description
I have a JSON schema like so:
{
"properties": {
"_id": {
"type": "string"
},
"animal": {
"type": "string"
},
"c": {
"properties": {
"danger": {
"type": "boolean"
},
"very": {
"type": "boolean"
}
},
"required": [
"danger"
],
"type": "object"
},
"zoo": {
"type": "string"
}
},
"required": [
"_id",
"animal"
],
"type": "object"
}
Validation only works at the top level:
from jsonschema import validate
rec = {'_id': '1', 'zoo': 'le', 'animal': 'lion'}
validate(rec, schema) # success
However, I would expect the validation to fail, because I have no field ['c']['danger']. Am I doing something wrong or does jsonschema not validate nested "required" fields?
Thx a lot!
Metadata
Metadata
Assignees
Labels
No labels