Skip to content
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

600.03 is not a multiple of 0.01 #679

Closed
ra-coder opened this issue Apr 12, 2020 · 2 comments
Closed

600.03 is not a multiple of 0.01 #679

ra-coder opened this issue Apr 12, 2020 · 2 comments

Comments

@ra-coder
Copy link

>>> jsonschema.validate(600.03, {'$schema': 'http://json-schema.org/draft-07/schema#', 'type': 'number', 'multipleOf': 0.01})
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.7/dist-packages/jsonschema/validators.py", line 934, in validate
    raise error
jsonschema.exceptions.ValidationError: 600.03 is not a multiple of 0.01

Failed validating 'multipleOf' in schema:
    {'$schema': 'http://json-schema.org/draft-07/schema#',
     'multipleOf': 0.01,
     'type': 'number'}

On instance:
    600.03
>>> jsonschema.__version__
'3.2.0'


@ra-coder
Copy link
Author

can be fixed via

{ "type": "number", "multipleOfPrecision": 0.01 }

@jsenecal
Copy link

jsenecal commented Jan 30, 2023

Raising awareness here, multipleOfPrecision actualy disables validation altogether.

There is no such thing as a multipleOfPrecision keyword in the JSON Schema specification.

Julian added a commit that referenced this issue Aug 3, 2023
5cc9214e8 Merge pull request #681 from json-schema-org/gregsdennis/ref-to-ref-to-non-local-target
c946d3671 update previous test set to consistently use file extensions; add to draft-next
a0097d4d0 Merge pull request #679 from json-schema-org/gregsdennis/ref-to-ref-to-non-local-target
8b69249a1 added tests for checking the entire resource for anchors instead of just the local subschema
8cdfac41e Port new multiple dynamic paths test to draft-next
cd441d2e4 A whole new version of multiple dynamic paths
e93077e20 Simplify test for dynamic ref with multiple paths

git-subtree-dir: json
git-subtree-split: 5cc9214e82f1e0a5e9644960b6fe0166afb7b283
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