From c38a68d85a2837c7a5a00dec0a0eb41d3175347e Mon Sep 17 00:00:00 2001 From: Sydney Runkle <54324534+sydney-runkle@users.noreply.github.com> Date: Tue, 15 Oct 2024 10:49:55 -0400 Subject: [PATCH] Add `serialization` key to `InvalidSchema` (#1482) --- python/pydantic_core/core_schema.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python/pydantic_core/core_schema.py b/python/pydantic_core/core_schema.py index cd1525b6a..2d51d544d 100644 --- a/python/pydantic_core/core_schema.py +++ b/python/pydantic_core/core_schema.py @@ -439,6 +439,9 @@ class InvalidSchema(TypedDict, total=False): type: Required[Literal['invalid']] ref: str metadata: Dict[str, Any] + # note, we never plan to use this, but include it for type checking purposes to match + # all other CoreSchema union members + serialization: SerSchema def invalid_schema(ref: str | None = None, metadata: Dict[str, Any] | None = None) -> InvalidSchema: