Skip to content
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

Breaking swagger #23

Open
lekhanhtoan37 opened this issue Apr 25, 2024 · 1 comment
Open

Breaking swagger #23

lekhanhtoan37 opened this issue Apr 25, 2024 · 1 comment

Comments

@lekhanhtoan37
Copy link

lekhanhtoan37 commented Apr 25, 2024

Access path /docs with raise exception from pydantic
image

  File "/Users/toanlk/Library/Caches/pypoetry/virtualenvs/python-ddd-PovSJyMx-py3.11/lib/python3.11/site-packages/pydantic/json_schema.py", line 2152, in handle_invalid_for_json_schema
    raise PydanticInvalidForJsonSchema(f'Cannot generate a JsonSchema for {error_info}')
pydantic.errors.PydanticInvalidForJsonSchema: Cannot generate a JsonSchema for core_schema.PlainValidatorFunctionSchema ({'type': 'with-info', 'function': <bound method GenericUUID.validate of <class 'seedwork.domain.value_objects.GenericUUID'>>})
@parthjoshi90
Copy link

parthjoshi90 commented Aug 25, 2024

Hello @lekhanhtoan37

It seems there is an issue because the GenericUUID being not serializable wherever it is used. for testing I have Annotated it differently and it worked.

like Annotated[str, GenericUUID].

I am not sure of the proper solution as still I am checking the entire code base and trying to understand each portion of it.
FastAPI - Swagger UI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants