You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would expect that when an AvroBaseModel is serialized, it would use the alias of each field (in this case, schema instead of schema_)
The text was updated successfully, but these errors were encountered:
RuiLoureiro
changed the title
AvroBaseModel.asdict() does not respect pydantic's serialization_alias
take pydantic's alias into account when serializing AvroBaseModelNov 28, 2024
Describe the bug
I have an
AvroBaseModel
with a field namedschema
.Because
schema
is already a method defined in pydantic'sBaseModel
I have to use an alias.I am trying to serialize this model using https://github.com/marcosschroh/python-schema-registry-client.
The issue is that
AvroBaseModel.asdict()
ignores the aliasTo Reproduce
Expected behavior
I would expect that when an
AvroBaseModel
is serialized, it would use the alias of each field (in this case,schema
instead ofschema_
)The text was updated successfully, but these errors were encountered: