-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] pydantic.errors.PydanticInvalidForJsonSchema occured when APIRouter's response_model has PydanticObjectId Field #1087
Comments
Hi Guys. I'm facing the same issue. |
I met same issue too. |
1 similar comment
I met same issue too. |
Just hit this as well
Using the latest fix seems to help pydantic # Doesn't work
@router.post("/blah/{foo_id}/")
async def my_route(
body: ..., foo_id: PydanticObjectId
):
# Works
@router.post("/blah/{foo_id}")
async def my_route(
body: ..., foo_id: str
): |
Hi @pharmac1st, could you please provide some more information about your environment, like which Pydantic version are you using? |
fix: resolve PydanticObjectId JSON Schema generation issue Problem:
Solution:
|
That is not the wanted solution as it will not show "that field actually is bson ObjectId" on client side. I guess we need fix... |
It can't be related to encoders as it is occurs during mode="validation" step (route arguments). |
Issue seems to be related to that commit: 66d78bf |
I found workaround, plz check it 🐍 |
This prob is solved from 1.29.0 ver. tyvm. |
Describe the bug
pydantic.errors.PydanticInvalidForJsonSchema occured when APIRouter's response_model has PydanticObjectId Field
It occurs to beanie 1.28
To Reproduce
Stack trace
The text was updated successfully, but these errors were encountered: