Skip to content

Validation attributes ignored when wrong type is set ? #762

@maingoh

Description

@maingoh

Some behaviors seem bug prone to me, am i missing something ?

# No raise, is this schema supposed to be valid ? 
jsonschema.validate(instance='foo', schema={'type': 'string', 'minimum': 5})

# No raise, is this schema supposed to be valid ? 
jsonschema.validate(instance=3, schema={'type': 'integer', 'pattern': '^foo$'})

# No raise, can't we infer the expected type when pattern is set ? 
jsonschema.validate(instance=3, schema={'pattern': '^foo$'})

# No raise, can't we infer the expected type when a range is set ? 
jsonschema.validate(instance='foo', schema={'minimum': 3})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions