I'm trying to define a schema inside a python script, to be used right away to validate some json data. the schema definition looks like this:
response_schema = {
"required": ["identifiers" ],
"properties": {
"identifiers": {
"minProperties": 1,"maxProperties": 1,
"additionalProperties": {
"required": [ "name","surname" ],
"properties": {
"surname": {
"required": ["sur1", "sur2" ],
"properties": {
"sur1": { },
"sur2": { }
} },
"name": {},
"additionalProperties": false
}
}
}
},
"additionalProperties": false
}
That schema works fine in any online validator, but when I execute the validation in my script:
validate(response_body_dict, response_schema)
I get the following error:
NameError: name 'false' is not defined
If I remove the lines "additionalProperties" : false
from the schema I don't get the error, but of course it doesn't work for me, as it is a much less restrictive validation.
Can anyone please explain why I am getting this error?