From a951c8a24fd5557622240de504c667e3900f3be5 Mon Sep 17 00:00:00 2001 From: Apiwat Chantawibul Date: Sat, 7 Oct 2023 02:20:45 +0700 Subject: [PATCH] Fix #429: bug on serialization to json --- docs/advanced/combine-pydantic-and-semver.rst | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/advanced/combine-pydantic-and-semver.rst b/docs/advanced/combine-pydantic-and-semver.rst index 1b68a59f..840ddbd4 100644 --- a/docs/advanced/combine-pydantic-and-semver.rst +++ b/docs/advanced/combine-pydantic-and-semver.rst @@ -46,9 +46,7 @@ To work with Pydantic>2.0, use the following steps: from_str_schema, ] ), - serialization=core_schema.plain_serializer_function_ser_schema( - lambda instance: instance.x - ), + serialization = core_schema.to_string_ser_schema(), ) @classmethod