Can JSON schema enumerations be case insensitive?

JSON Schema Enumerations

Enumerations of JSON Schemas functions that impose a restriction on string type values :

{
    "type": "array",
    "items": [
        {
            "type": "number"
        },
        {
            "type": "string"
        },
        {
            "type": "string",
            "enum": ["Street", "Avenue", "Boulevard"]
        },
        {
            "type": "string",
            "enum": ["NW", "NE", "SW", "SE"]
        }
    ]
}

This circuit checks values ​​such as [1600, "Pennsylvania", "Avenue", "NW"].

Problem

Is there an elegant way to make case enuminsensitive so that both Avenueare and Avenueare accepted as the third value in the array?

Other possible solutions

I can use anyOfin the list of values ​​and check each of them against a case-sensitive regular expression - but it is cumbersome, error-prone and inelegant.

+4
1

, . , .

, , . , n , , .., anyOf, . json-. , .

. , , . json-schema, "" .

+4

All Articles