Skip to content

Commit 7072ec4

Browse files
authored
Add missing entries in missing-sentinel core schema (#1765)
1 parent bb5a9b3 commit 7072ec4

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

python/pydantic_core/core_schema.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1348,12 +1348,21 @@ class Color(Enum):
13481348

13491349
class MissingSentinelSchema(TypedDict, total=False):
13501350
type: Required[Literal['missing-sentinel']]
1351+
metadata: dict[str, Any]
1352+
serialization: SerSchema
13511353

13521354

1353-
def missing_sentinel_schema() -> MissingSentinelSchema:
1355+
def missing_sentinel_schema(
1356+
metadata: dict[str, Any] | None = None,
1357+
serialization: SerSchema | None = None,
1358+
) -> MissingSentinelSchema:
13541359
"""Returns a schema for the `MISSING` sentinel."""
13551360

1356-
return {'type': 'missing-sentinel'}
1361+
return _dict_not_none(
1362+
type='missing-sentinel',
1363+
metadata=metadata,
1364+
serialization=serialization,
1365+
)
13571366

13581367

13591368
# must match input/parse_json.rs::JsonType::try_from

0 commit comments

Comments
 (0)