Skip to content

[BUG]: Serialization_alias on pydantic #1112

@liel-almog

Description

@liel-almog

Describe the bug
Beanie do not use the serialization_alias using Pydantic.

To Reproduce

class A(Dcoument, BaseModel):
    foo: str = Field(serialization_alias="bar")

a = A(foo="zoo")

a.save()

Expected behavior
The behavior should be exactly the same as if I was using the alias parameter in the Field.
When saving the document I want to see the aliased name.

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions