mirror of
https://github.com/LukeHagar/connexion.git
synced 2025-12-07 12:27:46 +00:00
Extract JSON request body validation to middleware (#1588)
* Set up code skeleton for validation middleware * Add more boilerplate code * WIP * Add ASGI JSONBodyValidator * Revert example changes * Remove incorrect content type test Co-authored-by: Ruwan <ruwanlambrichts@gmail.com>
This commit is contained in:
@@ -95,8 +95,7 @@ def test_errors(problem_app):
|
||||
)
|
||||
assert unsupported_media_type_body["type"] == "about:blank"
|
||||
assert unsupported_media_type_body["title"] == "Unsupported Media Type"
|
||||
assert (
|
||||
unsupported_media_type_body["detail"]
|
||||
== "Invalid Content-type (text/html), expected JSON data"
|
||||
assert unsupported_media_type_body["detail"].startswith(
|
||||
"Invalid Content-type (text/html)"
|
||||
)
|
||||
assert unsupported_media_type_body["status"] == 415
|
||||
|
||||
Reference in New Issue
Block a user