[BUG] RecursionError from response model
See original GitHub issueDescribe the bug
RecursionError from response model
- Create a file with:
from __future__ import annotations
from fastapi import FastAPI
from pydantic import BaseModel
class Response(BaseModel):
children: 'Response'
Response.update_forward_refs()
app = FastAPI()
@app.get("/", response_model=Response)
def read_root():
return {"Hello": "World"}
- start app and it throws a RecursionError
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
python - About the maximum recursion error in FastAPI
I think I have found the answer, it is because of the addition of cross-domain caused by the use of middleware way to...
Read more >Recursion Error While Handling Recursion Error
The correct answer here is “Which version of Python?” In Python 3, the interpreter freaks out and bails. >>> g() Fatal Python error:...
Read more >Python RecursionError: Maximum Recursion Depth ...
You might have seen a Python RecursionError exception when running your Python code. Why does this happen? Is there a way to fix...
Read more >maximum recursion depth exceeded while calling a Python ...
1、When running in Django, a bug appears as follows ... is all partial omission in the loop recursion error,So I've omitted some of...
Read more >`RecursionError` when deleting a model instance in Admin
Dear forum, please consider these models: from django.db import models ... the constructor to be invoked again, causing the recursion error.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is a pydantic issue, not fastAPI https://github.com/samuelcolvin/pydantic/issues/1370
Thanks for the help here everyone! 👏 🙇
Thanks for reporting back and closing the issue 👍