Skip to content

multipleOf validate bug #930

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nazarov-ae opened this issue Apr 5, 2022 · 1 comment
Closed

multipleOf validate bug #930

nazarov-ae opened this issue Apr 5, 2022 · 1 comment

Comments

@nazarov-ae
Copy link

nazarov-ae commented Apr 5, 2022

hi

pip list | grep jsonschema
jsonschema          4.4.0
import jsonschema
jsonschema.validate(instance=300.51, schema={'multipleOf': 0.01, 'type': 'number'})
jsonschema.validate(instance=300.52, schema={'multipleOf': 0.01, 'type': 'number'})
Traceback (most recent call last):
  File "/home/spice/.pyenv/versions/3.8.3/lib/python3.8/code.py", line 90, in runcode
    exec(code, self.locals)
  File "<input>", line 1, in <module>
  File "/home/spice/dev/pik/amqp-handler/venv/lib/python3.8/site-packages/jsonschema/validators.py", line 1022, in validate
    raise error
jsonschema.exceptions.ValidationError: 300.52 is not a multiple of 0.01
Failed validating 'multipleOf' in schema:
    {'multipleOf': 0.01, 'type': 'number'}
On instance:
    300.52
@Julian
Copy link
Member

Julian commented Apr 5, 2022

Hi there. This is a dupe of #810 and others listed there.

@Julian Julian closed this as completed Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants