-
-
Notifications
You must be signed in to change notification settings - Fork 603
Closed
Description
Using jsonschema 2.4.0 my data do not validate if expecting a number to be 92.6 and being
>>> import jsonschema
>>> schema = {"type": "number", "multipleOf": 0.1}
>>> jsonschema.validate(92.6, schema)
ValidationError Traceback (most recent call last)
<ipython-input-5-3d74877445e9> in <module>()
----> 1 jsonschema.validate(92.6, schema)
/home/javl/Envs/jsonizer/lib/python2.7/site-packages/jsonschema/validators.pyc in validate(instance, schema, cls, *args, **kwargs)
426 cls = validator_for(schema)
427 cls.check_schema(schema)
--> 428 cls(schema, *args, **kwargs).validate(instance)
/home/javl/Envs/jsonizer/lib/python2.7/site-packages/jsonschema/validators.pyc in validate(self, *args, **kwargs)
115 def validate(self, *args, **kwargs):
116 for error in self.iter_errors(*args, **kwargs):
--> 117 raise error
118
119 def is_type(self, instance, type):
ValidationError: 92.6 is not a multiple of 0.1
Failed validating 'multipleOf' in schema:
{'multipleOf': 0.1, 'type': 'number'}
On instance:
92.6
Metadata
Metadata
Assignees
Labels
No labels