Union of a model with a Color raises error in creating openAPI.json
.
#8160
Replies: 6 comments
-
Not sure if you're allowed to use |
Beta Was this translation helpful? Give feedback.
-
it's not a bug in FastAPI @jorgecarleitao |
Beta Was this translation helpful? Give feedback.
-
@euri10, got it. Thanks. Is there anything to report to pydantic then? If yes, what would be the minimal example for them? |
Beta Was this translation helpful? Give feedback.
-
I just created a PR @jorgecarleitao |
Beta Was this translation helpful? Give feedback.
-
Perfect. Thanks a lot, @euri10. I am closing this so that we monitor it from there. |
Beta Was this translation helpful? Give feedback.
-
Thanks @euri10 for your help here and implementing it in Pydantic! 🍰 🚀 Thanks @jorgecarleitao for reporting back and closing the issue. Just in case, this should be available in a recent version of FastAPI. |
Beta Was this translation helpful? Give feedback.
-
To Reproduce
main.py
):run
uvicorn main:app
open http://127.0.0.1:8000/docs
See error (
Failed to load API definition
on the browser), mini stack trace:Expected behavior
No error
Environment:
Additional context
No additional context, plain FastAPI. I am not sure if this is coming from pydantic or fastAPI: it may be a pydantic problem, or how fastAPI is using pydantic.
Beta Was this translation helpful? Give feedback.
All reactions