Replies: 1 comment
-
|
You can use --type-overrides to replace generated types with your own custom types that have serializers defined (e.g., --type-overrides '{"MyField": "my_app.types.MySerializedType"}' where MySerializedType is an Annotated type with PlainSerializer). |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am using the
JsonSchemaParserto generate Pydantic v2 models. Is there a way to define a custom serializer for a field?A
@field_serializermethod or annotation withPlainSerializerorWrapSerializerwould be suitable.Beta Was this translation helpful? Give feedback.
All reactions