Fixes response_validator to handle 3.0 responses and validate against the schema.

JSON::Validator already handles anyOf oneOf schema definitions, so those can be passed in and validation errors are returned properly
This commit is contained in:
Jay Danielian
2019-07-20 14:33:51 -04:00
parent cd348b53f8
commit 4c2097e017
6 changed files with 52 additions and 21 deletions

View File

@@ -243,7 +243,14 @@
"thumbnail": null
},
"schema": {
"$ref": "#/components/schemas/blog"
"oneOf": [
{
"$ref": "#/components/schemas/blog"
},
{
"$ref": "#/components/schemas/flexible_blog"
}
]
}
}
}
@@ -395,14 +402,13 @@
"nullable": true
},
"thumbnail": {
"type": "string"
"type": "string",
"nullable": true
}
},
"required": [
"id",
"title",
"content",
"thumbnail"
"title"
]
},
"flexible_blog": {
@@ -419,13 +425,13 @@
"nullable": true
},
"thumbnail": {
"type": "string"
"type": "string",
"nullable": true
}
},
"required": [
"id",
"headline",
"thumbnail"
"headline"
]
}
},