Skip to content
Discussion options

You must be logged in to vote

This issue comes from FastAPI, not SQLModel.
fastapi/fastapi#12066

If I'm right, it will only happen when you specified the response model. Try removing response model from your endpoint (or, return JSONResponse directly to bypass the response validation) and this should work without errors.

UPD: in the initial code example there is even more obvious problem - blocking database IO is used inside async ednpoint functions. So, it should be either refactored to using async DB interactions, or endpoint functions should be converted to sync (just def, not async def)

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@ghost
Comment options

@YuriiMotov
Comment options

Answer selected by tiangolo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
2 participants