Pydantic · Class
PlainSerializer
PlainSerializer uses a function to change how an annotated value is serialized. It can declare the output type and run only in selected serialization modes.
Last updated
Syntax
PlainSerializer(func, *, return_type=..., when_used='always')In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
WrapSerializerfield_serializermodel_serializerSerializationInfo