-
-
Notifications
You must be signed in to change notification settings - Fork 611
jsonschema validator issue -- validate a wrong schema #512
Copy link
Copy link
Closed
Labels
InvalidNot a bug, PEBKAC, or an unsupported setupNot a bug, PEBKAC, or an unsupported setup
Description
>>> import jsonschema
>>> jsonschema.__version__
'2.6.0'
>>> event = {
"event": "entry.u",
"timestamp": 1546467787.4796588,
"data": {
"orgId": 316,
"requestId": 1128121473,
"entryIds": [
98
]
}
}
>>> t = {
"properties": {
"event": {
"enum": [
"un",
"entry.u"
]
},
"data": {
"required": ["entryIds"],
"properties": {
"entryIds": {
"contains": {
"enum": [
980
]
}
}
}
}
},
"required": [
"event"
]
}
>>> jsonschema.validate(event, t)
>>>
The validation should fail as the entryIds are not matching. I tested this with some online validators and they all failed, but it passes using jsonschema.validate. Any clues? what am I missing here?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
InvalidNot a bug, PEBKAC, or an unsupported setupNot a bug, PEBKAC, or an unsupported setup