-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
Pydantic excluded fields are being exported to schema and fail serialization #314
Comments
Thanks for reporting the bug. I will try to solve it asap |
perfect, thank you :) |
I have released a new version with the fix. Here is the documentation |
thank you! :) |
This fix introduced a regression |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello!
When using pydantic (AvroBaseModel) - if a field is marked as excluded, it's still being exported to schema and serialization raises an error. Pydantic internal fields (beginning with underscore) are being ignored but those marked as excluded are not.
Current behavior:
this results in schema:
{"type": "record", "name": "Message", "fields": [{"name": "internal_field", "type": "string"}, {"name": "public_field", "type": "string"}]}
Object serialization:
raises an error:
Which of course make sense as this value is not provided by pydantic - because it's excluded.
Expected behavior
Excluded message is not reflected in schema and serialization.
The text was updated successfully, but these errors were encountered: