Skip to content

Instance validates if multipleOf is an integer, but fails if it's a float #1159

Open
@Zac-HD

Description

@Zac-HD
from jsonschema import validate

instance = 9007199254740995
validate(instance, schema={"type": "integer", "multipleOf": 11})    # passes
validate(instance, schema={"type": "integer", "multipleOf": 11.0})  # fails

I'm pretty sure that this is a bug, on the basis that the spec says all integer-valued numbers should be treated as integers.

Found via python-jsonschema/hypothesis-jsonschema#103.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething doesn't work the way it should.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions