Skip to content

"enum" does not work within "items" #426

Closed
@erayd

Description

@erayd

Tested using the following against 2d404b8 on 6.0.0-dev. "two" is not defined in the enum, but is still considered valid. This should actually be an error.

Other constraints within items seem to work fine.

{
    "testArray": ["one", "two", "three"]
}
{
    "type": "object",
    "properties": {
        "testArray": {
            "type": "array",
            "items": {
                "type": "string",
                "enum": ["one", "three"]
            }
        }
    }
}
steve@neith /tmp $ ~/dev/json-schema/bin/validate-json --verbose test.json schema.json
OK. The supplied JSON validates against the schema.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions