Skip to content

MultipleOf validation Bug #687

Description

@noelwilsondel

Hello,

Firstly thanks for this library it's really useful, we have noticed some unusual behaviour on version 3.2.0 validation using multipleOf constraint for example:

>>> from jsonschema import validate
>>> schema = {
...     "type" : "object",
...     "properties" : {
...         "test" : {"type" : "number", "multipleOf": 0.001},
...     },
... }
>>> # This should be valid but raises validation error
>>> validate(instance={"test" : 0.95}, schema=schema)

Some other things we noticed using the above value this passes:

>>> # This is valid
>>> validate(instance={"test" : 0.01}, schema=schema)
>>> # This is valid
>>> validate(instance={"test" : 0.1}, schema=schema)
>>> # This is invalid
>>> validate(instance={"test" : 0.95}, schema=schema)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions