I would like to create a json schema (draft-06) based on the following settings object:
"settingData" : {
"$id": "#settingData",
"oneOf" : [
{ "type" : "number" },
{ "type" : "array", "items" : { "oneOf" : [ { "type" : "number"},{ "type" : "null" } ] } },
{ "type" : "array", "items" : { "$ref" : "#setting" } }
]
},
"setting" : {
"$id": "#setting",
"type" : "object",
"properties" : {
"name": {
"type": "string",
"title": "type of setting",
"examples": [
"led-brightness"
]
},
"data": {
"$ref" : "#settingData"
}
},
"required" : ["type","data"]
},
I would like to create a specialization of this object, that has a settings name "status-ranges" and and contains a subset of the above definitions. How can I get my above type "settings" to not apply, when name is "status-ranges". I thought about using pattern, but regex patterns that match everything except a certain string seem a bit special, I tried one and it did not work. Then there is the not keyword but I am still looking for examples how that can be applied. Any Ideas ?