Skip to content

Adding attribute to ValidationError when additionalProperties is false #579

Closed
@mmerce

Description

@mmerce

When additionalProperties is set to false, the ValidationError attributes don't contain the key of the attribute that violates the validation. For instance, if schema = {"foo": "string", "additionalProperties": false}, then instance = {"bar": 1, "foo": "1"} will raise the error, but there's no way of knowing that bar was the cause of it. Is there an alternative way of finding that out? We need it in order to be able to filter JSON messages according to the defined schema.

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