Skip to content

Issue with the Enum in arrays #1141

@agustin-blanco

Description

@agustin-blanco

Hi Everyone, we are using json schema and found something weird when using enums in arrays.

For the simple json schema:
{ "type": "object", "additionalProperties": false, "properties": { "example": { "type": "array", "items": [ { "type": "string", "enum": [ "1", "2" ] } ] } } }

If you put:
{
"example": ["3","1"]
}
It fails saying that 3 is not in the enum. This behaviour is correct.

But if you put something correct first, then everything else passes the validation:
{
"example": ["1","3"]
}

Sorry if this is an open issue.
Thanks!

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