Skip to content

readonly works properly just in the first validation #311

Description

@mbarakaja

Given the next code:

from cerberus import Validator


v = Validator({
    'id': {'type': 'integer', 'readonly': True},
})


v.validate({'id': 1}) # False
v.validate({'id': 1}) # True
v.validate({'id': 1}) # True
v.validate({'id': 1}) # True

Just the first call validates correctly and return False. The subsequent calls to validate(...) return True. This just happen to me with property readonly. It looks like the validation works just on time.

Is this an intentional behavior of this library?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    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