We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Support defining a serialization name on the model type that is applied any time that type is parsed by a DTO factory
from dataclasses import dataclass, field from typing import Annotated, Any, TypeAlias from litestar.dto.field import DTOField AliasedStr: TypeAlias = Annotated[str, DTOField(serialization_name="bar")] @dataclass class Message: id: str foo: AliasedStr
Impact should be relatively minor, adds yet another way to rename fields, however the pattern is already established for marking fields private.
Should we just bite the bullet and embellish DTOField with every parameter on DTOConfig that makes sense?
DTOField
DTOConfig
Note
While we are open for sponsoring on GitHub Sponsors and OpenCollective, we also utilize Polar.sh to engage in pledge-based sponsorship.
Check out all issues funded or available for funding on our Polar.sh Litestar dashboard
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Summary
Support defining a serialization name on the model type that is applied any time that type is parsed by a DTO factory
Basic Example
Drawbacks and Impact
Impact should be relatively minor, adds yet another way to rename fields, however the pattern is already established for marking fields private.
Unresolved questions
Should we just bite the bullet and embellish
DTOField
with every parameter onDTOConfig
that makes sense?Note
While we are open for sponsoring on GitHub Sponsors and
OpenCollective, we also utilize Polar.sh to engage in pledge-based sponsorship.
Check out all issues funded or available for funding on our Polar.sh Litestar dashboard
The text was updated successfully, but these errors were encountered: