fastapi-code-generator
fastapi-code-generator copied to clipboard
Empty `response_model` gets typehinted to `Any`, which is not imported
How to reproduce:
- Omit the
response_model
in the router decorator - Run this on the openapi.json file
- The result's main.py would have used
Any
for the empty response model and type hint without importing it.
Why does this happen?
My take is that the datamodel-code-generator
you use to create schemas and resolve imports won't create this schema as its empty. Therefore its imports won't have Any
thus creating an unresolved import.
Is this what you meant by #114?