mirror of
https://github.com/ditkrg/rswag.git
synced 2026-01-25 07:16:40 +00:00
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:
@@ -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"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user