Skip to content

jsonschema validator issue -- validate a wrong schema #512

@fantamiracle

Description

@fantamiracle
>>> 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    InvalidNot a bug, PEBKAC, or an unsupported setup

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions