long2ice/fastapi-cache

Response model is missing in the OpenAPI spec and Swagger for @cache decorated endpoints

arseniiarsenii opened this issue · 2 comments

I've noticed, that response model is missing in the OpenAPI spec and Swagger for @cache decorated endpoints unless response_model is specified explicitly in the endpoint handler decorator, which is optional for newer versions of FastAPI. Specifying return type annotation of a handler function should be enough.

Versions (from pyproject.toml):

Thank you for your feedback, I will try to fix it.