@@ -372,35 +372,23 @@ def generate_definitions(
372372 Raises:
373373 PydanticUserError: Raised if the JSON schema generator has already been used to generate a JSON schema.
374374 """
375- return self ._generate_definitions ([(key , mode , schema , None ) for key , mode , schema in inputs ])
376-
377- def _generate_definitions (
378- self , inputs : Sequence [tuple [JsonSchemaKeyT , JsonSchemaMode , core_schema .CoreSchema , ConfigDict | None ]]
379- ) -> tuple [dict [tuple [JsonSchemaKeyT , JsonSchemaMode ], JsonSchemaValue ], dict [DefsRef , JsonSchemaValue ]]:
380- """Same as `generate_definitions()`, but with an additional config for each input.
381-
382- This config is used for core schemas that don't carry their own config (e.g. the core schema
383- of a type adapter).
384- """
385375 if self ._used :
386376 raise PydanticUserError (
387377 'This JSON schema generator has already been used to generate a JSON schema. '
388378 f'You must create a new instance of { type (self ).__name__ } to generate a new JSON schema.' ,
389379 code = 'json-schema-already-used' ,
390380 )
391381
392- for _ , mode , schema , config in inputs :
382+ for _ , mode , schema in inputs :
393383 self ._mode = mode
394- with self ._config_wrapper_stack .push (config ):
395- self .generate_inner (schema )
384+ self .generate_inner (schema )
396385
397386 definitions_remapping = self ._build_definitions_remapping ()
398387
399388 json_schemas_map : dict [tuple [JsonSchemaKeyT , JsonSchemaMode ], DefsRef ] = {}
400- for key , mode , schema , config in inputs :
389+ for key , mode , schema in inputs :
401390 self ._mode = mode
402- with self ._config_wrapper_stack .push (config ):
403- json_schema = self .generate_inner (schema )
391+ json_schema = self .generate_inner (schema )
404392 json_schemas_map [(key , mode )] = definitions_remapping .remap_json_schema (json_schema )
405393
406394 json_schema = {'$defs' : self .definitions }
0 commit comments