I have a json like this: {"mylist": ["a", "b", "c", "d", last_element]}
Here, last_element could be one of the following four strings - "w", "x", "y", "z"; but not multiple.
Examples:
{"mylist": ["a", "b", "c", "d", "x"] // <-- valid}{"mylist": ["a", "b", "c", "d", "y"] // <-- valid} {"mylist": ["a", "b", "c", "d", "x", "y"] // <-- not valid}
How to write a jsonschema for this?
Current attempt:
{"type":"object","properties":{"mylist":{"type":"array","items":{"type":"string","enum":["a","b","c","d","w","x","y","z" ] },"minItems":1,"uniqueItems":true } },"required":["mylist" ],"additionalProperties":false}