hi.
tried to create a Schema-representation of the following JSON Schema element:
"responses": {
"type": "object",
"description": "Response objects names can either be any valid HTTP status code or 'default'.",
"minProperties": 1,
"additionalProperties": false,
"patternProperties": {
"^([0-9]+)$|^(default)$": {
"$ref": "#/definitions/response"
},
"^x-": {
"$ref": "#/definitions/vendorExtension"
}
}
, but it requires two predicate keys, which is not allowed.
(s/defschema Responses
{(s/either (s/eq :default) s/Int) (s/maybe Response)
#"x-" VendorExtension})
... which fails on validation with More than one non-optional/required key schemata: [(either (eq :default) Int) #"x-"]
could combine the two keys into single either and wrap values into either too, but that would allow ill combinations.
Any suggestions?
Tommi