jsonschema multiple values for string property

If you want data to be one of a fixed set of exact values, you can use enum:

{
    "type": "string",
    "enum": ["stop", "go"]
}

So, to fit this in your example, try:

{
    "type": "object",
    "properties": {
        "$gte": {
            "type": "string",
            "oneOf": [
                {"pattern": "<some-pattern>"},
                {"enum": ["TOKEN", "ANOTHER_TOKEN"]}
            ]
        }
    }
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)