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
The feature request is to add support for something like validation_alias=callable that behaves similarly to rename but only one way (the decode step).
For some prior art, pydantic has 3 ways to define aliases:
The alias parameter is used for both validation and serialization. If you want to use different aliases for validation and serialization respectively, you can use thevalidation_alias and serialization_alias parameters, which will apply only in their respective use cases.
Something I realised while thinking about this is that it can possibly be added as rename=... parameter to the msgspec.*.Encoder and msgspec.*.Decoder classes for a significantly more fine grained control over aliases across the conversion boundaries.
Description
Currently
rename
on a Struct is always two-ways.The feature request is to add support for something like
validation_alias=callable
that behaves similarly torename
but only one way (the decode step).For some prior art, pydantic has 3 ways to define aliases:
The text was updated successfully, but these errors were encountered: