@@ -1971,13 +1971,15 @@ class _ValidatorFunctionSchema(TypedDict, total=False):
1971
1971
1972
1972
class BeforeValidatorFunctionSchema (_ValidatorFunctionSchema , total = False ):
1973
1973
type : Required [Literal ['function-before' ]]
1974
+ json_schema_input_schema : CoreSchema
1974
1975
1975
1976
1976
1977
def no_info_before_validator_function (
1977
1978
function : NoInfoValidatorFunction ,
1978
1979
schema : CoreSchema ,
1979
1980
* ,
1980
1981
ref : str | None = None ,
1982
+ json_schema_input_schema : CoreSchema | None = None ,
1981
1983
metadata : Dict [str , Any ] | None = None ,
1982
1984
serialization : SerSchema | None = None ,
1983
1985
) -> BeforeValidatorFunctionSchema :
@@ -2003,6 +2005,7 @@ def fn(v: bytes) -> str:
2003
2005
function: The validator function to call
2004
2006
schema: The schema to validate the output of the validator function
2005
2007
ref: optional unique identifier of the schema, used to reference the schema in other places
2008
+ json_schema_input_schema: The core schema to be used to generate the corresponding JSON Schema input type
2006
2009
metadata: Any other information you want to include with the schema, not used by pydantic-core
2007
2010
serialization: Custom serialization schema
2008
2011
"""
@@ -2011,6 +2014,7 @@ def fn(v: bytes) -> str:
2011
2014
function = {'type' : 'no-info' , 'function' : function },
2012
2015
schema = schema ,
2013
2016
ref = ref ,
2017
+ json_schema_input_schema = json_schema_input_schema ,
2014
2018
metadata = metadata ,
2015
2019
serialization = serialization ,
2016
2020
)
@@ -2022,6 +2026,7 @@ def with_info_before_validator_function(
2022
2026
* ,
2023
2027
field_name : str | None = None ,
2024
2028
ref : str | None = None ,
2029
+ json_schema_input_schema : CoreSchema | None = None ,
2025
2030
metadata : Dict [str , Any ] | None = None ,
2026
2031
serialization : SerSchema | None = None ,
2027
2032
) -> BeforeValidatorFunctionSchema :
@@ -2051,6 +2056,7 @@ def fn(v: bytes, info: core_schema.ValidationInfo) -> str:
2051
2056
field_name: The name of the field
2052
2057
schema: The schema to validate the output of the validator function
2053
2058
ref: optional unique identifier of the schema, used to reference the schema in other places
2059
+ json_schema_input_schema: The core schema to be used to generate the corresponding JSON Schema input type
2054
2060
metadata: Any other information you want to include with the schema, not used by pydantic-core
2055
2061
serialization: Custom serialization schema
2056
2062
"""
@@ -2059,6 +2065,7 @@ def fn(v: bytes, info: core_schema.ValidationInfo) -> str:
2059
2065
function = _dict_not_none (type = 'with-info' , function = function , field_name = field_name ),
2060
2066
schema = schema ,
2061
2067
ref = ref ,
2068
+ json_schema_input_schema = json_schema_input_schema ,
2062
2069
metadata = metadata ,
2063
2070
serialization = serialization ,
2064
2071
)
@@ -2073,6 +2080,7 @@ def no_info_after_validator_function(
2073
2080
schema : CoreSchema ,
2074
2081
* ,
2075
2082
ref : str | None = None ,
2083
+ json_schema_input_schema : CoreSchema | None = None ,
2076
2084
metadata : Dict [str , Any ] | None = None ,
2077
2085
serialization : SerSchema | None = None ,
2078
2086
) -> AfterValidatorFunctionSchema :
@@ -2096,6 +2104,7 @@ def fn(v: str) -> str:
2096
2104
function: The validator function to call after the schema is validated
2097
2105
schema: The schema to validate before the validator function
2098
2106
ref: optional unique identifier of the schema, used to reference the schema in other places
2107
+ json_schema_input_schema: The core schema to be used to generate the corresponding JSON Schema input type
2099
2108
metadata: Any other information you want to include with the schema, not used by pydantic-core
2100
2109
serialization: Custom serialization schema
2101
2110
"""
@@ -2104,6 +2113,7 @@ def fn(v: str) -> str:
2104
2113
function = {'type' : 'no-info' , 'function' : function },
2105
2114
schema = schema ,
2106
2115
ref = ref ,
2116
+ json_schema_input_schema = json_schema_input_schema ,
2107
2117
metadata = metadata ,
2108
2118
serialization = serialization ,
2109
2119
)
@@ -2189,6 +2199,7 @@ class WrapValidatorFunctionSchema(TypedDict, total=False):
2189
2199
function : Required [WrapValidatorFunction ]
2190
2200
schema : Required [CoreSchema ]
2191
2201
ref : str
2202
+ json_schema_input_schema : CoreSchema
2192
2203
metadata : Dict [str , Any ]
2193
2204
serialization : SerSchema
2194
2205
@@ -2198,6 +2209,7 @@ def no_info_wrap_validator_function(
2198
2209
schema : CoreSchema ,
2199
2210
* ,
2200
2211
ref : str | None = None ,
2212
+ json_schema_input_schema : CoreSchema | None = None ,
2201
2213
metadata : Dict [str , Any ] | None = None ,
2202
2214
serialization : SerSchema | None = None ,
2203
2215
) -> WrapValidatorFunctionSchema :
@@ -2226,13 +2238,15 @@ def fn(
2226
2238
function: The validator function to call
2227
2239
schema: The schema to validate the output of the validator function
2228
2240
ref: optional unique identifier of the schema, used to reference the schema in other places
2241
+ json_schema_input_schema: The core schema to be used to generate the corresponding JSON Schema input type
2229
2242
metadata: Any other information you want to include with the schema, not used by pydantic-core
2230
2243
serialization: Custom serialization schema
2231
2244
"""
2232
2245
return _dict_not_none (
2233
2246
type = 'function-wrap' ,
2234
2247
function = {'type' : 'no-info' , 'function' : function },
2235
2248
schema = schema ,
2249
+ json_schema_input_schema = json_schema_input_schema ,
2236
2250
ref = ref ,
2237
2251
metadata = metadata ,
2238
2252
serialization = serialization ,
@@ -2244,6 +2258,7 @@ def with_info_wrap_validator_function(
2244
2258
schema : CoreSchema ,
2245
2259
* ,
2246
2260
field_name : str | None = None ,
2261
+ json_schema_input_schema : CoreSchema | None = None ,
2247
2262
ref : str | None = None ,
2248
2263
metadata : Dict [str , Any ] | None = None ,
2249
2264
serialization : SerSchema | None = None ,
@@ -2274,6 +2289,7 @@ def fn(
2274
2289
function: The validator function to call
2275
2290
schema: The schema to validate the output of the validator function
2276
2291
field_name: The name of the field this validators is applied to, if any
2292
+ json_schema_input_schema: The core schema to be used to generate the corresponding JSON Schema input type
2277
2293
ref: optional unique identifier of the schema, used to reference the schema in other places
2278
2294
metadata: Any other information you want to include with the schema, not used by pydantic-core
2279
2295
serialization: Custom serialization schema
@@ -2282,6 +2298,7 @@ def fn(
2282
2298
type = 'function-wrap' ,
2283
2299
function = _dict_not_none (type = 'with-info' , function = function , field_name = field_name ),
2284
2300
schema = schema ,
2301
+ json_schema_input_schema = json_schema_input_schema ,
2285
2302
ref = ref ,
2286
2303
metadata = metadata ,
2287
2304
serialization = serialization ,
@@ -2292,6 +2309,7 @@ class PlainValidatorFunctionSchema(TypedDict, total=False):
2292
2309
type : Required [Literal ['function-plain' ]]
2293
2310
function : Required [ValidationFunction ]
2294
2311
ref : str
2312
+ json_schema_input_schema : CoreSchema
2295
2313
metadata : Dict [str , Any ]
2296
2314
serialization : SerSchema
2297
2315
@@ -2300,6 +2318,7 @@ def no_info_plain_validator_function(
2300
2318
function : NoInfoValidatorFunction ,
2301
2319
* ,
2302
2320
ref : str | None = None ,
2321
+ json_schema_input_schema : CoreSchema | None = None ,
2303
2322
metadata : Dict [str , Any ] | None = None ,
2304
2323
serialization : SerSchema | None = None ,
2305
2324
) -> PlainValidatorFunctionSchema :
@@ -2321,13 +2340,15 @@ def fn(v: str) -> str:
2321
2340
Args:
2322
2341
function: The validator function to call
2323
2342
ref: optional unique identifier of the schema, used to reference the schema in other places
2343
+ json_schema_input_schema: The core schema to be used to generate the corresponding JSON Schema input type
2324
2344
metadata: Any other information you want to include with the schema, not used by pydantic-core
2325
2345
serialization: Custom serialization schema
2326
2346
"""
2327
2347
return _dict_not_none (
2328
2348
type = 'function-plain' ,
2329
2349
function = {'type' : 'no-info' , 'function' : function },
2330
2350
ref = ref ,
2351
+ json_schema_input_schema = json_schema_input_schema ,
2331
2352
metadata = metadata ,
2332
2353
serialization = serialization ,
2333
2354
)
@@ -2338,6 +2359,7 @@ def with_info_plain_validator_function(
2338
2359
* ,
2339
2360
field_name : str | None = None ,
2340
2361
ref : str | None = None ,
2362
+ json_schema_input_schema : CoreSchema | None = None ,
2341
2363
metadata : Dict [str , Any ] | None = None ,
2342
2364
serialization : SerSchema | None = None ,
2343
2365
) -> PlainValidatorFunctionSchema :
@@ -2360,13 +2382,15 @@ def fn(v: str, info: core_schema.ValidationInfo) -> str:
2360
2382
function: The validator function to call
2361
2383
field_name: The name of the field this validators is applied to, if any
2362
2384
ref: optional unique identifier of the schema, used to reference the schema in other places
2385
+ json_schema_input_schema: The core schema to be used to generate the corresponding JSON Schema input type
2363
2386
metadata: Any other information you want to include with the schema, not used by pydantic-core
2364
2387
serialization: Custom serialization schema
2365
2388
"""
2366
2389
return _dict_not_none (
2367
2390
type = 'function-plain' ,
2368
2391
function = _dict_not_none (type = 'with-info' , function = function , field_name = field_name ),
2369
2392
ref = ref ,
2393
+ json_schema_input_schema = json_schema_input_schema ,
2370
2394
metadata = metadata ,
2371
2395
serialization = serialization ,
2372
2396
)
0 commit comments