{
"$comment": "validate maps, in particular those with constrained string keys",
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"MapWithKeys": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Value"
},
"propertyNames": {
"$ref": "#/definitions/Eh"
}
},
"Value": {
"type": "string"
},
"Eh": {
"type": "string",
"format": "^a*$"
},
"MapWithDateTimeKeys": {
"$comment": "test that a type isn't needed for propertyNames",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Value"
},
"propertyNames": {
"format": "date-time"
}
},
"MapWithDateKeys": {
"$comment": "test that a type isn't needed for propertyNames",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Value"
},
"propertyNames": {
"format": "date"
}
}
},
"$comment": "usual case of a map whose name must come from its title",
"title": "DeadSimple",
"type": "object"
}