Closed
Description
I encountered a very cumbersome issue, which might be related to implementation of validators, but the ones I tried all do it.
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"version": {
"type": "string"
},
"image64":{
"type": "string"
}
},
"required": [
"version"
],
"patternProperties": {
"^[A-Za-z0-9_]+$": {
"title": "Task Name"
"type": "object",
"properties": {
"action":{
"type": "string"
},
"schedule": {
"type": "object",
"properties": {
"timedelta": {
"type": "object",
"properties": {
"minutes": {
"type": "integer"
}
},
"required": [
"minutes"
]
}
},
"required": [
"timedelta"
]
}
}
}
}
}
The version and image64 property fail validation since they are catched by regex on pattern and therefore must be object and not string. Yes I can write a regex excluding them, but what happen if I need to add one more static property? Edit it again. I think requiring evaluation of static properties first should be mandatory to avoid this issue.