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

fix pydantic json-schema serialization #18

Merged

Conversation

mperesson
Copy link
Contributor

Using DataURI as a type in my pydantic model with fastapi, it made the openapi documentation generation crash.

This is because it tried to serialize python function and method that came from __get_pydantic_core_schema__.

I rewrote __get_pydantic_json_schema__ based on the pydantic doc (https://docs.pydantic.dev/2.10/concepts/json_schema/#implementing-__get_pydantic_json_schema__) so it only contains serializable types.

Copy link
Owner

@fcurella fcurella left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@fcurella fcurella merged commit c573ff1 into fcurella:master Jan 3, 2025
19 checks passed
@mperesson
Copy link
Contributor Author

looks like you don't run linter on PR 😬
sorry!

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

Successfully merging this pull request may close these issues.

2 participants