You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@web.middleware
async def validation_middleware(request: web.Request, handler) -> web.Response:
orig_handler = request.match_info.handler
if not hasattr(orig_handler, "__schemas__"):
...
schemas = sub_handler.__schemas__
else:
schemas = orig_handler.__schemas__
# --- start adding ---
if "responses" in orig_handler.__apispec__:
for info in orig_handler.__apispec__["responses"].values():
assert "schema" in info
assert "description" in info
assert "required" in info or "name" in info
# --- end adding ---
result = {}
...
Some fields are missing from
__apispec__["responses"]
The code for test:
Let's add some code to show the trouble.
aiohttp_apispec.py
middlewares.py
decorators/response.py
Let's run the test. Log:
There is no info about 'required' and 'name' in Response for GET. But this info is in Response for HEAD!
The text was updated successfully, but these errors were encountered: