It is possible for inferring_router to raise an exception if a function uses a return type that is not a valid response_model. An example is an endpoint that returns Response instead of letting FastAPI construct one.
This PR fixes that by only inferring the response_model if the return annotation is a valid response_model.
It is possible for
inferring_router
to raise an exception if a function uses a return type that is not a validresponse_model
. An example is an endpoint that returnsResponse
instead of letting FastAPI construct one.This PR fixes that by only inferring the
response_model
if the return annotation is a validresponse_model
.Fixes #229 Fixes #172