@@ -736,16 +736,10 @@ def nullable_schema(
736736 return dict_not_none (type = 'nullable' , schema = schema , strict = strict , ref = ref , extra = extra )
737737
738738
739- class CustomError (TypedDict , total = False ):
740- kind : Required [str ]
741- message : str
742- context : Dict [str , Union [str , int ]]
743-
744-
745739class UnionSchema (TypedDict , total = False ):
746740 type : Required [Literal ['union' ]]
747741 choices : Required [List [CoreSchema ]]
748- custom_error_kind : str
742+ custom_error_type : str
749743 custom_error_message : str
750744 custom_error_context : Dict [str , Union [str , int , float ]]
751745 strict : bool
@@ -755,7 +749,7 @@ class UnionSchema(TypedDict, total=False):
755749
756750def union_schema (
757751 * choices : CoreSchema ,
758- custom_error_kind : str | None = None ,
752+ custom_error_type : str | None = None ,
759753 custom_error_message : str | None = None ,
760754 custom_error_context : dict [str , str | int ] | None = None ,
761755 strict : bool | None = None ,
@@ -765,7 +759,7 @@ def union_schema(
765759 return dict_not_none (
766760 type = 'union' ,
767761 choices = choices ,
768- custom_error_kind = custom_error_kind ,
762+ custom_error_type = custom_error_type ,
769763 custom_error_message = custom_error_message ,
770764 custom_error_context = custom_error_context ,
771765 strict = strict ,
@@ -780,7 +774,7 @@ class TaggedUnionSchema(TypedDict, total=False):
780774 discriminator : Required [
781775 Union [str , List [Union [str , int ]], List [List [Union [str , int ]]], Callable [[Any ], Optional [str ]]]
782776 ]
783- custom_error_kind : str
777+ custom_error_type : str
784778 custom_error_message : str
785779 custom_error_context : Dict [str , Union [str , int , float ]]
786780 strict : bool
@@ -792,7 +786,7 @@ def tagged_union_schema(
792786 choices : Dict [str , CoreSchema ],
793787 discriminator : str | list [str | int ] | list [list [str | int ]] | Callable [[Any ], str | None ],
794788 * ,
795- custom_error_kind : str | None = None ,
789+ custom_error_type : str | None = None ,
796790 custom_error_message : str | None = None ,
797791 custom_error_context : dict [str , int | str | float ] | None = None ,
798792 strict : bool | None = None ,
@@ -803,7 +797,7 @@ def tagged_union_schema(
803797 type = 'tagged-union' ,
804798 choices = choices ,
805799 discriminator = discriminator ,
806- custom_error_kind = custom_error_kind ,
800+ custom_error_type = custom_error_type ,
807801 custom_error_message = custom_error_message ,
808802 custom_error_context = custom_error_context ,
809803 strict = strict ,
@@ -989,7 +983,7 @@ def recursive_reference_schema(schema_ref: str) -> RecursiveReferenceSchema:
989983class CustomErrorSchema (TypedDict , total = False ):
990984 type : Required [Literal ['custom_error' ]]
991985 schema : Required [CoreSchema ]
992- custom_error_kind : Required [str ]
986+ custom_error_type : Required [str ]
993987 custom_error_message : str
994988 custom_error_context : Dict [str , Union [str , int , float ]]
995989 ref : str
@@ -998,7 +992,7 @@ class CustomErrorSchema(TypedDict, total=False):
998992
999993def custom_error_schema (
1000994 schema : CoreSchema ,
1001- custom_error_kind : str ,
995+ custom_error_type : str ,
1002996 * ,
1003997 custom_error_message : str | None = None ,
1004998 custom_error_context : dict [str , str | int | float ] | None = None ,
@@ -1008,7 +1002,7 @@ def custom_error_schema(
10081002 return dict_not_none (
10091003 type = 'custom_error' ,
10101004 schema = schema ,
1011- custom_error_kind = custom_error_kind ,
1005+ custom_error_type = custom_error_type ,
10121006 custom_error_message = custom_error_message ,
10131007 custom_error_context = custom_error_context ,
10141008 ref = ref ,
@@ -1067,9 +1061,9 @@ def json_schema(schema: CoreSchema | None = None, *, ref: str | None = None, ext
10671061 JsonSchema ,
10681062]
10691063
1070- # used in _pydantic_core.pyi::PydanticKindError
1064+ # used in _pydantic_core.pyi::PydanticKnownError
10711065# to update this, call `pytest -k test_all_errors` and copy the output
1072- ErrorKind = Literal [
1066+ ErrorType = Literal [
10731067 'json_invalid' ,
10741068 'json_type' ,
10751069 'recursion_loop' ,
0 commit comments