Skip to content

Commit bd313ed

Browse files
authored
Merge pull request #430 from apiwat-chantawibul/fix-semver-pydantic-serialization
Fix #429: bug on serialization to json
2 parents 1f08632 + a951c8a commit bd313ed

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

docs/advanced/combine-pydantic-and-semver.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ To work with Pydantic>2.0, use the following steps:
4646
from_str_schema,
4747
]
4848
),
49-
serialization=core_schema.plain_serializer_function_ser_schema(
50-
lambda instance: instance.x
51-
),
49+
serialization = core_schema.to_string_ser_schema(),
5250
)
5351
5452
@classmethod

0 commit comments

Comments
 (0)