Skip to content

readOnly and writeOnly with jsonschema4 doesn't work #40

Description

@p1c2u

Given schema and validator:

schema = {
    "type": "object",
    "properties": {
        "some_prop": {
            "type": "string",
            "readOnly": True
        }
    },
    "required": ["some_prop"]
}
validator = OAS30Validator(schema, format_checker=oas30_format_checker, write=True)

For the following instance:

validator.validate({"some_prop": "hello"})

in jsonschem3 we get error (correct):

Tried to write read-only property with hello

In jsonschem4 we get no errors (incorrect)

The issue exists in all versions <0.3.0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions