HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.10/dist-packages/pydantic/__pycache__/json_schema.cpython-310.pyc
o

|��gݹ�@sVUdZddlmZddlZddlZddlZddlZddlZddl	Z	ddl
mZddlm
Z
ddlmZddlmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZddl Z ddl m!Z!m"Z"m#Z#m$Z$dd	l%m&Z&dd
l'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-ddl.m/Z/m0Z0dd
l1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9ddl:m;Z;ddl<m=Z=m>Z>ddl?m@Z@mAZAmBZBer�ddlCmDZDddlEmFZFmGZGddlHmIZIddlJmKZKddlLmMZMe)e#jNe#jOfZP	eeQefZR	e)dZS	ddd�ZTdeUd<e)dZV	Gdd�deW�ZXdZY	edeQ�ZZed eQ�Z[ed!eQ�Z\eeZeSfZ]ed"ed#�Z^ej_d^ie6j`��Gd$d%�d%��ZaGd&d'�d'�Zbd(eYebd)fd_d6d7�Zcd(ddeYebd8�d`d?d@�ZdeeeefeQegdedAeeeQdBfdCffZhdDeUdB<dadHdI�ZidbdLdM�Zjej_d^ie6j`��GdNdO�dO��ZkGdPdQ�dQ�ZldcdUdV�ZmedW�Zne�r�e(endCfZonej_d^ie6j`��GdXdY�dY��Zoddd\d]�ZpdS)ea�
Usage docs: https://docs.pydantic.dev/2.5/concepts/json_schema/

The `json_schema` module contains classes and functions to allow the way [JSON Schema](https://json-schema.org/)
is generated to be customized.

In general you shouldn't need to use this module directly; instead, you can use
[`BaseModel.model_json_schema`][pydantic.BaseModel.model_json_schema] and
[`TypeAdapter.json_schema`][pydantic.TypeAdapter.json_schema].
�)�annotationsN)�defaultdict)�deepcopy)�Enum)�
TYPE_CHECKING�Any�Callable�Counter�Dict�Hashable�Iterable�NewType�Pattern�Sequence�Tuple�TypeVar�Union�cast�overload)�
CoreSchema�PydanticOmit�core_schema�to_jsonable_python)�
ComputedField)�	Annotated�Literal�	TypeAlias�assert_never�
deprecated�final)�PydanticDeprecatedSince26�PydanticDeprecatedSince29�)�_config�_core_metadata�_core_utils�_decorators�_internal_dataclass�
_mock_val_ser�_schema_generation_shared�
_typing_extra)�GetJsonSchemaHandler)�JsonDict�	JsonValue)�PydanticInvalidForJsonSchema�PydanticSchemaGenerationError�PydanticUserError)�
ConfigDict)�CoreSchemaField�CoreSchemaOrField)�PydanticDataclass)�GetJsonSchemaFunction��	BaseModel)�
validation�
serialization�Input�Outputzdict[JsonSchemaMode, str]�_MODE_TITLE_MAPPING)�skipped-choice�non-serializable-default�skipped-discriminatorc@seZdZdZdS)�PydanticJsonSchemaWarningaThis class is used to emit warnings produced during JSON schema generation.
    See the [`GenerateJsonSchema.emit_warning`][pydantic.json_schema.GenerateJsonSchema.emit_warning] and
    [`GenerateJsonSchema.render_warning_message`][pydantic.json_schema.GenerateJsonSchema.render_warning_message]
    methods for more details; these can be overridden to control warning behavior.
    N)�__name__�
__module__�__qualname__�__doc__�rErE�?/usr/local/lib/python3.10/dist-packages/pydantic/json_schema.pyr@hsr@z#/$defs/{model}�CoreRef�DefsRef�JsonRef�JsonSchemaKeyT)�boundc@sJeZdZUded<ded<eddd
��Zddd�Zddd�Zddd�ZdS)�_DefinitionsRemappingzdict[DefsRef, DefsRef]�defs_remappingzdict[JsonRef, JsonRef]�json_remapping�prioritized_choices�dict[DefsRef, list[DefsRef]]�defs_to_json�dict[DefsRef, JsonRef]�definitions�dict[DefsRef, JsonSchemaValue]�returncs�t|�}d|i}td�D]d}tt��|D]}||}|D]}�|�||�qq�D]
}t�|��|<q+i}	i}
|D]}||}t�fdd�|D��}||	|<|||
||<q<t|	|
�}
|
�d|i�}||krn|
S|}qt	d��)z�
        This function should produce a remapping that replaces complex DefsRef with the simpler ones from the
        prioritized_choices such that applying the name remapping would result in an equivalent JSON schema.
        �$defs�dc3s$�|]
}t�|�dkr|VqdS)r"N)�len��.0�x��schemas_for_alternativesrErF�	<genexpr>�s�"zA_DefinitionsRemapping.from_prioritized_choices.<locals>.<genexpr>z.Failed to simplify the JSON schema definitions)
r�ranger�list�append�_deduplicate_schemas�nextrL�remap_json_schemar.)rOrQrS�copied_definitions�definitions_schema�_iter�defs_ref�alternatives�alternativerMrN�original_defs_ref�remapped_defs_ref�	remapping�new_definitions_schemarEr\rF�from_prioritized_choices�s0�
z._DefinitionsRemapping.from_prioritized_choices�refrHcC�|j�||�S�N)rM�get��selfrprErErF�remap_defs_ref��z$_DefinitionsRemapping.remap_defs_refrIcCrqrr)rNrsrtrErErF�remap_json_ref�rwz$_DefinitionsRemapping.remap_json_ref�schemarcs�t|t�r��t|��St|t�r�fdd�|D�St|t�rV|��D]2\}}|dkr:t|t�r:��t|��|d<q#|dkrN�fdd�|d��D�|d<q#��|�||<q#|S)zH
        Recursively update the JSON schema replacing all $refs
        c�g|]}��|��qSrE)rd�rZ�item�rurErF�
<listcomp>��z;_DefinitionsRemapping.remap_json_schema.<locals>.<listcomp>�$refrVcs&i|]\}}��t|����|��qSrE)rvrHrd)rZ�key�valuer}rErF�
<dictcomp>�s��z;_DefinitionsRemapping.remap_json_schema.<locals>.<dictcomp>)�
isinstance�strrxrIr`�dict�itemsrd)ruryr�r�rEr}rFrd�s




�z'_DefinitionsRemapping.remap_json_schemaN)rOrPrQrRrSrTrUrL)rprHrUrH)rprIrUrI)ryrrUr)	rArBrC�__annotations__�staticmethodrorvrxrdrErErErFrL�s

.
rLc@s0eZdZUdZdZdhZded<def�dDdd�Ze	�dEdd��Z
e	�dFdd��Z�dGdd�Z�dHdd�Z
�dI�dJd!d"�Z�dKd$d%�Z�dL�dMd*d+�Z�dL�dNd-d.�Z�dOd0d1�Z�dPd3d4�Z�dQd6d7�Z�dRd9d:�Z�dSd<d=�Z�dTd?d@�Z�dUdBdC�Z�dVdEdF�Z�dWdHdI�Z�dXdKdL�Z�dYdNdO�Z�dZdQdR�Z�d[dTdU�Z�d\dWdX�Z�d]dZd[�Z �d^d]d^�Z!�d_d`da�Z"�d`dcdd�Z#�dadfdg�Z$e%dhd&di�e&�dbdkdl���Z'e%dmd&di�e&�dbdndo���Z(�dbdpdq�Z)�dcdsdt�Z*�dddvdw�Z+�dedydz�Z,�dfd|d}�Z-�dgdd��Z.�dhd�d��Z/�did�d��Z0�djd�d��Z1�dkd�d��Z2�dld�d��Z3�dmd�d��Z4�dnd�d��Z5�dod�d��Z6�dpd�d��Z7�dqd�d��Z8�drd�d��Z9�dsd�d��Z:�dtd�d��Z;e<�dud�d���Z=�dvd�d��Z>�dwd�d��Z?�dxd�d��Z@�dyd�d��ZA�dzd�d��ZB�d{d�d„ZC�d|d�dńZD�d}d�d̈́ZE�d~d�dτZF�dd�d҄ZG�d�d�dԄZH�d�d�d؄ZI�d�d�dۄZJ�d�d�dބZK�d�d�d�ZL�d�d�d�ZM�d�d�d�ZN�d�d�d�ZO�d�d�d�ZP�d�d�d�ZQ�d�d�d��ZR�d�d�d��ZS�d�d�d��ZT�d�d��d�ZU�d��d�d�ZV�d��d�d�ZW�d��d	�d
�ZX�d��d�d
�ZY�d��d�d�ZZ�d��d�d�Z[�d��d�d�Z\�d��d�d�Z]�d��d�d�Z^�d~�d�d�Z_�d��d"�d#�Z`�d��d%�d&�Za�d��d*�d+�ZbG�d,�d-��d-�Zc�d��d0�d1�Zd�d��d3�d4�Ze�d��d6�d7�Zf�d��d;�d<�Zg�d��d=�d>�Zh�d��d@�dA�Zi�d��dB�dC�Zjd&S(��GenerateJsonSchemaa&Usage docs: https://docs.pydantic.dev/2.10/concepts/json_schema/#customizing-the-json-schema-generation-process

    A class for generating JSON schemas.

    This class generates JSON schemas based on configured parameters. The default schema dialect
    is [https://json-schema.org/draft/2020-12/schema](https://json-schema.org/draft/2020-12/schema).
    The class uses `by_alias` to configure how fields with
    multiple names are handled and `ref_template` to format reference names.

    Attributes:
        schema_dialect: The JSON schema dialect used to generate the schema. See
            [Declaring a Dialect](https://json-schema.org/understanding-json-schema/reference/schema.html#id4)
            in the JSON Schema documentation for more information about dialects.
        ignored_warning_kinds: Warnings to ignore when generating the schema. `self.render_warning_message` will
            do nothing if its argument `kind` is in `ignored_warning_kinds`;
            this value can be modified on subclasses to easily control which warnings are emitted.
        by_alias: Whether to use field aliases when generating the schema.
        ref_template: The format string used when generating reference names.
        core_to_json_refs: A mapping of core refs to JSON refs.
        core_to_defs_refs: A mapping of core refs to definition refs.
        defs_to_core_refs: A mapping of definition refs to core refs.
        json_to_defs_refs: A mapping of JSON refs to definition refs.
        definitions: Definitions in the schema.

    Args:
        by_alias: Whether to use field aliases in the generated schemas.
        ref_template: The format string to use when generating reference names.

    Raises:
        JsonSchemaError: If the instance of the class is inadvertently reused after generating a schema.
    z,https://json-schema.org/draft/2020-12/schemar=zset[JsonSchemaWarningKind]�ignored_warning_kindsT�by_alias�bool�ref_templater�cCsr||_||_i|_i|_i|_i|_i|_t�t�	i��|_
d|_i|_t
t�|_i|_|��|_i|_d|_dS)Nr8F)r�r��core_to_json_refs�core_to_defs_refs�defs_to_core_refs�json_to_defs_refsrSr#�ConfigWrapperStack�
ConfigWrapper�_config_wrapper_stack�_mode�_prioritized_defsref_choicesr�int�_collision_counter�_collision_index�build_schema_type_to_method�_schema_type_to_method�"_core_defs_invalid_for_json_schema�_used)rur�r�rErErF�__init__�s


zGenerateJsonSchema.__init__rU�_config.ConfigWrappercCs|jjSrr)r��tailr}rErErFr# szGenerateJsonSchema._config�JsonSchemaModecCs|jjdur
|jjS|jSrr)r#�json_schema_mode_overrider�r}rErErF�mode$szGenerateJsonSchema.mode�Kdict[CoreSchemaOrFieldType, Callable[[CoreSchemaOrField], JsonSchemaValue]]cCs�i}t�t�}|D]?}|�dd��d�}z	t||�||<Wq	tyH}ztjddkr2WYd}~q	td|�dt	|�j
�d	|�d
��|�d}~ww|S)aOBuilds a dictionary mapping fields to methods for generating JSON schemas.

        Returns:
            A dictionary containing the mapping of `CoreSchemaOrFieldType` to a handler method.

        Raises:
            TypeError: If no method has been defined for generating a JSON schema for a given pydantic core schema type.
        �-�_�_schema�-PYDANTIC_PRIVATE_ALLOW_UNHANDLED_SCHEMA_TYPES�1Nz9No method for generating JsonSchema for core_schema.type=z (expected: �.�))r*�literal_values�CoreSchemaOrFieldType�replace�getattr�AttributeError�os�environ�	TypeError�typerA)ru�mapping�core_schema_typesr��method_name�erErErFr�+s.�������z.GenerateJsonSchema.build_schema_type_to_method�inputs�GSequence[tuple[JsonSchemaKeyT, JsonSchemaMode, core_schema.CoreSchema]]�ctuple[dict[tuple[JsonSchemaKeyT, JsonSchemaMode], JsonSchemaValue], dict[DefsRef, JsonSchemaValue]]c	Cs�|jrtdt|�j�d�dd��|D]
\}}}||_|�|�q|��}i}|D]\}}}||_|�|�}|�|�|||f<q(d|ji}|�|�}d|_||�	|d�fS)a�Generates JSON schema definitions from a list of core schemas, pairing the generated definitions with a
        mapping that links the input keys to the definition references.

        Args:
            inputs: A sequence of tuples, where:

                - The first element is a JSON schema key type.
                - The second element is the JSON mode: either 'validation' or 'serialization'.
                - The third element is a core schema.

        Returns:
            A tuple where:

                - The first element is a dictionary whose keys are tuples of JSON schema key type and JSON mode, and
                    whose values are the JSON schema corresponding to that pair of inputs. (These schemas may have
                    JsonRef references to definitions that are defined in the second returned element.)
                - The second element is a dictionary whose keys are definition references for the JSON schemas
                    from the first returned element, and whose values are the actual JSON schema definitions.

        Raises:
            PydanticUserError: Raised if the JSON schema generator has already been used to generate a JSON schema.
        �nThis JSON schema generator has already been used to generate a JSON schema. You must create a new instance of � to generate a new JSON schema.�json-schema-already-used��coderVT)
r�r0r�rAr��generate_inner�_build_definitions_remappingrdrS�sort)	rur�r�r�ry�definitions_remapping�json_schemas_mapr��json_schemarErErF�generate_definitionsGs(��


z'GenerateJsonSchema.generate_definitionsr8ryrr��JsonSchemaValuecCs�||_|jrtdt|�j�d�dd��|�|�}|�|�}tt|�	d��}|durX|�
|�}||dkrR|durRt|�dkrR|��}||d8<tt|�	d��}d}|dus)|�
|�|��}|jri|j|d<|�|�}d	|_|�|�S)
a�Generates a JSON schema for a specified schema in a specified mode.

        Args:
            schema: A Pydantic model.
            mode: The mode in which to generate the schema. Defaults to 'validation'.

        Returns:
            A JSON schema representing the specified schema.

        Raises:
            PydanticUserError: If the JSON schema generator has already been used to generate a JSON schema.
        r�r�r�r�r�Nr"rVT)r�r�r0r�rAr��get_json_ref_countsrrIrs�get_schema_from_definitionsrX�copy�_garbage_collect_definitionsr�rSrdr�)ruryr�r��json_ref_countsrp�ref_json_schemar�rErErF�generatexs4
��


 �
	


zGenerateJsonSchema.generater3cs`d|vr#t|d�}|�jf}|�jvr#�j|�jvr#d�j|iSd �fdd	��d!��fdd
�}t��|�}ttj	|�
di��}|�
d��rX|fd"�fdd�
}t��|�}|�
d��rn|fd"�fdd�
}t��|�}|�
dd�D]}	||	fd#�fdd�
}
t��|
�}qt|�
dd�D]}	||	fd#�fdd�
}
t��|
�}q�||�}t�|�r��||�}|S)$a�Generates a JSON schema for a given core schema.

        Args:
            schema: The given core schema.

        Returns:
            The generated JSON schema.

        TODO: the nested function definitions here seem like bad practice, I'd like to unpack these
        in a future PR. It'd be great if we could shorten the call stack a bit for JSON schema generation,
        and I think there's potential for that here.
        rpr�rrr�r�rUcs^d|vr-t|d�}��|�\}}t|d�}|�dd�|kr+|�j|<�j�|d�|}|S)Nrpr�)rG�get_cache_defs_ref_schemarIrsrSr��pop)rr��core_refrhr��json_refr}rErF�
populate_defs�s
z8GenerateJsonSchema.generate_inner.<locals>.populate_defs�schema_or_fieldr3cs�d}�jdkr.d|vr.|d}��|�}|dur.|�d�dvr.|ddkr.��ddi|g�}|durOt�|�s<t�|�rH�j|d}||�}ntd|����t�|�rY�||�}|S)	a@Generate a JSON schema based on the input schema.

            Args:
                schema_or_field: The core schema to generate a JSON schema from.

            Returns:
                The generated JSON schema.

            Raises:
                TypeError: If an unexpected schema type is encountered.
            Nr9�	when_used�zunless-nonezjson-unless-noner��nullable�null�Unexpected schema type: schema=)	r��
ser_schemars�get_flattened_anyofr%�is_core_schema�is_core_schema_fieldr�r�)r�r�r��generate_for_schema_type)r�rurErF�handler_func�s 




z7GenerateJsonSchema.generate_inner.<locals>.handler_func�metadata�pydantic_js_updates�current_handlerr+csi||����}|SrrrE�r�r�r�)�
js_updatesrErF�js_updates_handler_func�szBGenerateJsonSchema.generate_inner.<locals>.js_updates_handler_func�pydantic_js_extracs8||�}t�t�r|�t���|St��r�|�|Srr)r�r��updater�callabler�)�js_extrarErF�js_extra_handler_funcs
�z@GenerateJsonSchema.generate_inner.<locals>.js_extra_handler_func�pydantic_js_functionsrE�js_modify_functionr5csJ|||�}t�|�r�||�}|�|�}|�dd�}|r#|r#|�|�|S)Nr�)r%r��resolve_ref_schemar�r�)r�r�r�r��original_schemarp�r�rErF�new_handler_funcs




z;GenerateJsonSchema.generate_inner.<locals>.new_handler_func� pydantic_js_annotation_functionscs"|||�}t�|�r�||�}|Srr)r%r�)r�r�r�r�r�rErFr�)s


N)rrr�r�rUr�)r�r3rUr�)r�r3r�r+rUr�)r�r3r�r+r�r5rUr�)
rGr�r�rSr�r)�GenerateJsonSchemaHandlerrr$�CoreMetadatarsr%r�)ruryr��
core_mode_refr�r�r�r�r�r�r�r�rE)r�r�r�rurFr��s>
'����


z!GenerateJsonSchema.generate_innerNr��
parent_key�
str | NonecCs@i}|��}|dvrt|�}|D]
}|j|||d�||<q|S)apOverride this method to customize the sorting of the JSON schema (e.g., don't sort at all, sort all keys unconditionally, etc.)

        By default, alphabetically sort the keys in the JSON schema, skipping the 'properties' and 'default' keys to preserve field definition order.
        This sort is recursive, so it will sort all nested dictionaries as well.
        ��
properties�default�r�)�keys�sorted�_sort_recursive)rur�r��sorted_dictr�r�rErErFr�:szGenerateJsonSchema.sortrcCs|t|t�r%i}|��}|dvrt|�}|D]
}|j|||d�||<q|St|t�r<g}|D]}|�|�||��q.|S|S)z%Recursively sort a JSON schema value.r�r�)r�r�r�r�r�r`ra)rur�r�rr�r��sorted_listr|rErErFr�Hs

z"GenerateJsonSchema._sort_recursive�core_schema.InvalidSchemacCstd��)z%Placeholder - should never be called.zKCannot generate schema for invalid_schema. This is a bug! Please report it.)�RuntimeError�ruryrErErF�invalid_schema\sz!GenerateJsonSchema.invalid_schema�core_schema.AnySchemacC�iS)z�Generates a JSON schema that matches any value.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        rErrErErF�
any_schemaas	zGenerateJsonSchema.any_schema�core_schema.NoneSchemacC�ddiS)z�Generates a JSON schema that matches `None`.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r�r�rErrErErF�none_schemal�	zGenerateJsonSchema.none_schema�core_schema.BoolSchemacCr
)z�Generates a JSON schema that matches a bool value.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r��booleanrErrErErF�bool_schemawrzGenerateJsonSchema.bool_schema�core_schema.IntSchemacC�0ddi}|�|||jj�dd�|��D�}|S)z�Generates a JSON schema that matches an int value.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r��integercS�(i|]\}}|tjtjhvr||�qSrE��math�inf�rZ�k�vrErErFr���(z1GenerateJsonSchema.int_schema.<locals>.<dictcomp>��update_with_validations�ValidationsMapping�numericr��ruryr�rErErF�
int_schema��	zGenerateJsonSchema.int_schema�core_schema.FloatSchemacCr)z�Generates a JSON schema that matches a float value.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r��numbercSrrErrrErErFr��rz3GenerateJsonSchema.float_schema.<locals>.<dictcomp>rrrErErF�float_schema�r!zGenerateJsonSchema.float_schema�core_schema.DecimalSchemacCs�|�t���}|jdkrb|�d�}|�d�}|�d�}|�d�}|�d�}d|�tj|�d�|d	ur4d	nt|�|d	ur=d	nt|�|d	urFd	nt|�|d	urOd	nt|�|d	urXd	nt|�d
��|gi}|S)z�Generates a JSON schema that matches a decimal value.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r8�multiple_of�le�ge�lt�gt�anyOf�
allow_inf_nanN)r,r&r'r(r)r*)�
str_schemarr�rsr$�float)ruryr�r&r'r(r)r*rErErF�decimal_schema�s,	





��
��z!GenerateJsonSchema.decimal_schema�core_schema.StringSchemacCs>ddi}|�|||jj�t|�d�t�r|�d�j|d<|S)z�Generates a JSON schema that matches a string value.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r��string�pattern)rrr1r�rsrr2rrErErFr-�s
	zGenerateJsonSchema.str_schema�core_schema.BytesSchemacCs0d|jjdkr	dndd�}|�|||jj�|S)z�Generates a JSON schema that matches a bytes value.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r1�base64�	base64url�binary�r��format)r#�ser_json_bytesrr�bytesrrErErF�bytes_schema�s	zGenerateJsonSchema.bytes_schema�core_schema.DateSchemacC�
ddd�S)z�Generates a JSON schema that matches a date value.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r1�dater7rErrErErF�date_schema��
	zGenerateJsonSchema.date_schema�core_schema.TimeSchemacCr=)z�Generates a JSON schema that matches a time value.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r1�timer7rErrErErF�time_schema�r@zGenerateJsonSchema.time_schema�core_schema.DatetimeSchemacCr=)z�Generates a JSON schema that matches a datetime value.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r1z	date-timer7rErrErErF�datetime_schema�r@z"GenerateJsonSchema.datetime_schema�core_schema.TimedeltaSchemacCs|jjdkr
ddiSddd�S)z�Generates a JSON schema that matches a timedelta value.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r.r�r#r1�durationr7)r#�ser_json_timedeltarrErErF�timedelta_schema�s	
z#GenerateJsonSchema.timedelta_schema�core_schema.LiteralSchemacCs�dd�|dD�}dd�|D�}i}t|�dkr|d|d<n||d<d	d
�|D�}|thkr5d|d<|S|thkr@d
|d<|S|thkrKd|d<|S|thkrVd|d<|S|thkrad|d<|S|td�hkrld|d<|S)z�Generates a JSON schema that matches a literal value.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        cSs g|]}t|t�r|jn|�qSrE)r�rr��rZrrErErFr~s z5GenerateJsonSchema.literal_schema.<locals>.<listcomp>�expectedcSsg|]}t|��qSrE)rrKrErErFr~�r"r�const�enumcS�h|]}t|��qSrE�r��rZr�rErErF�	<setcomp>rMz4GenerateJsonSchema.literal_schema.<locals>.<setcomp>r1r�rr#r�arrayNr�)rXr�r�r.r�r`r�)ruryrL�result�typesrErErF�literal_schema
s2	

�	
�
�
��z!GenerateJsonSchema.literal_schema�core_schema.EnumSchemacCs�|d}|js	dnt�|j�}|dkrd}|j|d�}dd�|��D�}dd�|d	D�}||d
<dd�|D�}t|t�sB|thkrHd
|d<|St|t�sR|thkrXd|d<|St|t�sb|thkrhd|d<|S|t	hkrsd|d<|S|t
hkr|d|d<|S)z�Generates a JSON schema that matches an Enum value.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        �clsNzAn enumeration.)�title�descriptioncSsi|]\}}|dur||�qSrrrErrErErFr�<�z2GenerateJsonSchema.enum_schema.<locals>.<dictcomp>cSsg|]}t|j��qSrE)rr�rKrErErFr~>rz2GenerateJsonSchema.enum_schema.<locals>.<listcomp>�membersrOcSrPrErQrRrErErFrSBrMz1GenerateJsonSchema.enum_schema.<locals>.<setcomp>r1r�rr#rrT)rD�inspect�cleandocrAr�r�r�r�r.r�r`)rury�	enum_typer[rUrLrVrErErF�enum_schema,s0	
��
�
�zGenerateJsonSchema.enum_schema�core_schema.IsInstanceSchemacCs|�|d|d�d��S)aHandles JSON schema generation for a core schema that checks if a value is an instance of a class.

        Unless overridden in a subclass, this raises an error.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        zcore_schema.IsInstanceSchema (rYr���handle_invalid_for_json_schemarrErErF�is_instance_schemaPsz%GenerateJsonSchema.is_instance_schema�core_schema.IsSubclassSchemacCr)aIHandles JSON schema generation for a core schema that checks if a value is a subclass of a class.

        For backwards compatibility with v1, this does not raise an error, but can be overridden to change this.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        rErrErErF�is_subclass_schema]sz%GenerateJsonSchema.is_subclass_schema�core_schema.CallableSchemacCs|�|d�S)z�Generates a JSON schema that matches a callable value.

        Unless overridden in a subclass, this raises an error.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        rhrcrrErErF�callable_schemaksz"GenerateJsonSchema.callable_schema�core_schema.ListSchemacC�:d|vrin|�|d�}d|d�}|�|||jj�|S)z�Returns a schema that matches a list schema.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        �items_schemarT�r�r��r�rrrT�ruryrlr�rErErF�list_schemax�	
zGenerateJsonSchema.list_schema�D`tuple_positional_schema` is deprecated. Use `tuple_schema` instead.)�category�core_schema.TupleSchemacC�tjdtdd�|�|�S)�Replaced by `tuple_schema`.rr���
stacklevel��warnings�warnr �tuple_schemarrErErF�tuple_positional_schema���
z*GenerateJsonSchema.tuple_positional_schema�B`tuple_variable_schema` is deprecated. Use `tuple_schema` instead.cCru)rvr�rwrxrzrrErErF�tuple_variable_schema�rz(GenerateJsonSchema.tuple_variable_schemacs�ddi}d|vr@|d}|dkr%||d<�fdd�|dd	|�D�|d
<|dt|d�kr;��|d|�|d<n"d
|d<n�fdd�|dD�}|rQ||d
<t|�|d<t|�|d<��||�jj�|S)z�Generates a JSON schema that matches a tuple schema e.g. `Tuple[int,
        str, bool]` or `Tuple[int, ...]`.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r�rT�variadic_item_indexr�minItemscrzrE�r�r{r}rErFr~�s
�z3GenerateJsonSchema.tuple_schema.<locals>.<listcomp>rlN�prefixItemsr"r�TcrzrEr�r{r}rErFr~�r�maxItems)rXr�rrrT)ruryr�r�r�rEr}rFr}�s$


�
zGenerateJsonSchema.tuple_schema�core_schema.SetSchemacC�
|�|�S)z�Generates a JSON schema that matches a set schema.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        ��_common_set_schemarrErErF�
set_schema�r@zGenerateJsonSchema.set_schema�core_schema.FrozenSetSchemacCr�)z�Generates a JSON schema that matches a frozenset schema.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r�rrErErF�frozenset_schema�r@z#GenerateJsonSchema.frozenset_schema�3core_schema.SetSchema | core_schema.FrozenSetSchemacCs<d|vrin|�|d�}dd|d�}|�|||jj�|S)NrlrTT)r��uniqueItemsr�rnrorErErFr��sz%GenerateJsonSchema._common_set_schema�core_schema.GeneratorSchemacCrk)z�Returns a JSON schema that represents the provided GeneratorSchema.

        Args:
            schema: The schema.

        Returns:
            The generated JSON schema.
        rlrTrmrnrorErErF�generator_schema�rqz#GenerateJsonSchema.generator_schema�core_schema.DictSchemacCs�ddi}d|vr|�|d���ni}d|vr$|�dd�}|�dd�nd}d|vr3|�|d���ni}|�dd�|sA|durP|durJ||d	<n||i|d
<|�d�dkr]t|�dksad|vrk|�dd�||d
<|�|||jj�|S)z�Generates a JSON schema that matches a dict schema.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r��object�keys_schemar�r2NrZ�
values_schema�additionalProperties�patternPropertiesr1r"�
propertyNames)r�r�r�rsrXrrr�)ruryr�r��keys_patternr�rErErF�dict_schema�s$	
zGenerateJsonSchema.dict_schema�)core_schema.BeforeValidatorFunctionSchemacC�0|jdkr|�d�}r|�|�S|�|d�S)z�Generates a JSON schema that matches a function-before schema.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r8�json_schema_input_schemary�r�rsr��rury�input_schemarErErF�function_before_schema�	
z)GenerateJsonSchema.function_before_schema�(core_schema.AfterValidatorFunctionSchemacC�|�|d�S)z�Generates a JSON schema that matches a function-after schema.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        ryr�rrErErF�function_after_schema%�	z(GenerateJsonSchema.function_after_schema�(core_schema.PlainValidatorFunctionSchemacCs:|jdkr|�d�}r|�|�S|�|d|d�d��S)z�Generates a JSON schema that matches a function-plain schema.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r8r�z*core_schema.PlainValidatorFunctionSchema (�functionr�)r�rsr�rdr�rErErF�function_plain_schema0s
	
�z(GenerateJsonSchema.function_plain_schema�'core_schema.WrapValidatorFunctionSchemacCr�)z�Generates a JSON schema that matches a function-wrap schema.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r8r�ryr�r�rErErF�function_wrap_schema@r�z'GenerateJsonSchema.function_wrap_schema�core_schema.WithDefaultSchemac	Cs�|�|d�}d|vr
|S|d}|jdkrY|d�d�}rY|�d�}rY|�d�dkrY|�d�sY|dur=|�d	�d
vsYz||�}WntyX|�dd|�d
��|YSwz|�|�}Wntjyv|�dd|�d��|YSw||d<|S)z�Generates a JSON schema that matches a schema with a default value.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        ryr�r9r�r��function-plain�info_argNr�r�r>zUnable to serialize value z> with the plain serializer; excluding default from JSON schemazDefault value z= is not JSON serializable; excluding default from JSON schema)r�r�rs�	Exception�emit_warning�encode_default�
pydantic_core�PydanticSerializationError)ruryr�r�r��ser_func�encoded_defaultrErErF�default_schemaNsB	
���
��

��z!GenerateJsonSchema.default_schema�core_schema.NullableSchemacCs0ddi}|�|d�}||kr|S|�||g�S)z�Generates a JSON schema that matches a schema that allows null values.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r�r�ry)r�r�)rury�null_schema�inner_json_schemarErErF�nullable_schema�s
	z"GenerateJsonSchema.nullable_schema�core_schema.UnionSchemacCs�g}|d}|D]8}t|t�r|dn|}z
|�|�|��Wqty(Yqty@}z
|�d|j�WYd}~qd}~wwt|�dkrK|dS|�	|�S)z�Generates a JSON schema that matches a schema that allows values matching any of the given schemas.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        �choicesrr=Nr")
r��tuplerar�rr.r��messagerXr�)rury�	generatedr��choice�
choice_schema�excrErErF�union_schema�s	��
zGenerateJsonSchema.union_schema�core_schema.TaggedUnionSchemac	Cs�i}|d��D]:\}}t|t�r|j}z
|�|���|t|�<Wqty*YqtyB}z
|�	d|j
�WYd}~qd}~wwt|���}d|i}|�
||�}|dure|dd�|��D�d�|d<|S)	acGenerates a JSON schema that matches a schema that allows values matching any of the given schemas, where
        the schemas are tagged with a discriminator field that indicates which schema should be used to validate
        the value.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r�r=N�oneOfcSsi|]\}}||�d|��qS)r��rsrrErErFr��r\z:GenerateJsonSchema.tagged_union_schema.<locals>.<dictcomp>)�propertyNamer��
discriminator)r�r�rr�r�r�r�rr.r�r�rb�values�_extract_discriminator)	ruryr�rrr��one_of_choicesr��openapi_discriminatorrErErF�tagged_union_schema�s(
��
�z&GenerateJsonSchema.tagged_union_schemar��list[JsonDict]c
Cs$d}t|dt�r
|dSt|dt�r�t|d�dkr+t|ddt�r+|ddS|dD]`}t|t�s9|St|�dkr@q/|d}t|t�sJq/d}|D]9}z|�|�}Wntys}z|�dt|��i}WYd}~nd}~ww|�di�}	t|	t�r�||	vr�d}nqN|r�|}|Sq/|S)	zvExtract a compatible OpenAPI discriminator from the schema and one_of choices that end up in the final
        schema.Nr�r"rTr?r�F)	r�r�r`rXr�rr�rsr�)
ruryr�r��
alias_path�alias�alias_is_present_on_all_choicesr�r�r�rErErFr��sF"
�
����z)GenerateJsonSchema._extract_discriminator�core_schema.ChainSchemacCs$|jdkrdnd}|�|d|�S)a�Generates a JSON schema that matches a core_schema.ChainSchema.

        When generating a schema for validation, we return the validation JSON schema for the first step in the chain.
        For serialization, we return the serialization JSON schema for the last step in the chain.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r8r����steps)r�r�)rury�
step_indexrErErF�chain_schema
szGenerateJsonSchema.chain_schema�core_schema.LaxOrStrictSchemacCs,|�dd�}|r|�|d�S|�|d�S)z�Generates a JSON schema that matches a schema that allows values matching either the lax schema or the
        strict schema.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        �strictF�
strict_schema�
lax_schema)rsr�)rury�
use_strictrErErF�lax_or_strict_schemasz'GenerateJsonSchema.lax_or_strict_schema�core_schema.JsonOrPythonSchemacCr�)a�Generates a JSON schema that matches a schema that allows values matching either the JSON schema or the
        Python schema.

        The JSON schema is used instead of the Python schema. If you want to use the Python schema, you should override
        this method.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r�r�rrErErF�json_or_python_schema,s
z(GenerateJsonSchema.json_or_python_schema�core_schema.TypedDictSchemacs�|�dd����fdd�|d��D�}�jdkr%|���|�dg���|�d�}t|�}�j�|��
��|�}Wd	�n1sDwY|d	urV��	|||�|S|�d
�}|dkred|d
<|S|dkrmd|d
<|S)z�Generates a JSON schema that matches a schema that defines a typed dict.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        �totalTcs,g|]\}}��|�r|��|��|f�qSrE��field_is_present�field_is_required�rZ�name�field�rur�rErFr~Es��z8GenerateJsonSchema.typed_dict_schema.<locals>.<listcomp>�fieldsr9�computed_fieldsrYN�extra�forbidFr��allow)
rsr�r��extend�_name_required_computed_fields�_get_typed_dict_configr��push�_named_required_fields_schema�_update_class_schema)rury�named_required_fieldsrY�configr�r�rEr�rF�typed_dict_schema;s*	
�

�
��z$GenerateJsonSchema.typed_dict_schemar��list[ComputedField]�1list[tuple[str, bool, core_schema.ComputedField]]cCsdd�|D�S)NcSsg|]	}|dd|f�qS)�
property_nameTrE�rZr�rErErFr~`�zEGenerateJsonSchema._name_required_computed_fields.<locals>.<listcomp>rE)r�rErErFr�\sz1GenerateJsonSchema._name_required_computed_fieldsr��+Sequence[tuple[str, bool, CoreSchemaField]]c
	Cs�i}g}|D]C\}}}|jr|�||�}z	|�|���}Wn	ty&Yqwd|vr9|�|�r9|�|�}||d<|�|�}|||<|rI|�|�qd|d�}	|rU||	d<|	S)NrZr��r�r��required)	r��_get_alias_namer�r�r�field_title_should_be_set�get_title_from_name�handle_ref_overridesra)
rur�r��required_fieldsr�r�r��field_json_schemarZr�rErErFr�bs,�


�
z0GenerateJsonSchema._named_required_fields_schemar�r2r�cCs�|ddkr
|�d|�}n|jdkr|�d|�}n|�d|�}t|t�r(|}|St|t�rRtd|�}|D]}t|t�rOt|�dkrOt|d	t�rO|d	}|Sq4|St|�|S)
Nr��computed-fieldr�r8�validation_alias�serialization_aliaszlist[str] | strr"r)rsr�r�r�r`rrXr)rur�r�r��pathrErErFr�{s&


�
$��z"GenerateJsonSchema._get_alias_name�core_schema.TypedDictFieldcCr�)z�Generates a JSON schema that matches a schema that defines a typed dict field.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        ryr�rrErErF�typed_dict_field_schema�r�z*GenerateJsonSchema.typed_dict_field_schema�core_schema.DataclassFieldcCr�)z�Generates a JSON schema that matches a schema that defines a dataclass field.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        ryr�rrErErF�dataclass_field_schema�r�z)GenerateJsonSchema.dataclass_field_schema�core_schema.ModelFieldcCr�)z�Generates a JSON schema that matches a schema that defines a model field.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        ryr�rrErErF�model_field_schema�r�z%GenerateJsonSchema.model_field_schema�core_schema.ComputedFieldcCr�)z�Generates a JSON schema that matches a schema that defines a computed field.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        �
return_schemar�rrErErF�computed_field_schema�r�z(GenerateJsonSchema.computed_field_schema�core_schema.ModelSchemacCs`td|d�}|j}|j�|��|�|d�}Wd�n1s"wY|�|||�|S)z�Generates a JSON schema that matches a schema that defines a model.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        ztype[BaseModel]rYryN)r�model_configr�r�r�r�)ruryrYr�r�rErErF�model_schema�s�zGenerateJsonSchema.model_schemar�rY�	type[Any]r�r1�NonecCs�ddlm}ddlm}|�d�}dur|�d|�n!|�d�}r=||�}t|t�s7td|�d|j	����|�d|�d|vrF|j
|d<||usOt�|�rQdn|j
}	|	r`|�d	t�|	��nt||�rs|jd
j}
rs|�d	|
�|�d�}d|vr�|d
kr�d|d<n|dkr�d|d<|�d�}t||�r�|jr�|jd
j}
|r�|
r�td��|
r�|
}t|ttf�r�|�|�}t|t�r�|�|�n%t|�r�tt�|�j�dkr�|||�n||�n|dur�td|�d���t |d�r�d|d<dSdS)a�Update json_schema with the following, extracted from `config` and `cls`:

        * title
        * description
        * additional properties
        * json_schema_extra
        * deprecated

        Done in place, hence there's no return value as the original json_schema is mutated.
        No ref resolving is involved here, as that's not appropriate for simple updates.
        r"r6)�	RootModelrZN�model_title_generatorzmodel_title_generator z must return str, not r[�rootr�r�r�Tr�F�json_schema_extrazz"model_config['json_schema_extra']" and "Field.json_schema_extra" on "RootModel.root" field must not be set simultaneouslyz"model_config['json_schema_extra']=z$ should be a dict, callable, or None�__deprecated__r)!�mainr7�
root_modelrrs�
setdefaultr�r�r��	__class__rA�dataclasses�is_dataclassrDr^r_�
issubclass�__pydantic_fields__r[�__pydantic_root_model__�model_fieldsr�
ValueErrorr��classmethod�__get__r�r�r�rX�	signature�
parameters�hasattr)rur�rYr�r7r�config_titlerrZ�	docstring�root_descriptionr�r�root_json_schema_extrarErErFr��s\




�



�
�z'GenerateJsonSchema._update_class_schemacCsBd|vr|S|d}|�t|��}|durtd|����|�|�S)a$Resolve a JsonSchemaValue to the non-ref schema if it is a $ref schema.

        Args:
            json_schema: The schema to resolve.

        Returns:
            The resolved schema.

        Raises:
            RuntimeError: If the schema reference can't be found in definitions.
        r�Nz(Cannot update undefined schema for $ref=)r�rIrr�)rur�rp�schema_to_updaterErErFr�s
z%GenerateJsonSchema.resolve_ref_schema�core_schema.ModelFieldsSchemacsv�fdd�|d��D�}�jdkr|���|�dg�����|�}|�dd�}|dur9��|�}��|�|d<|S)	z�Generates a JSON schema that matches a schema that defines a model's fields.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        cs.g|]\}}��|�r|�j|dd�|f�qS)T�r�r�r�r}rErFr~6s��z:GenerateJsonSchema.model_fields_schema.<locals>.<listcomp>r�r9r��
extras_schemaNr�)r�r�r�r�rsr�r�r�)ruryr�r�r2r/rEr}rF�model_fields_schema-s
	
�


z&GenerateJsonSchema.model_fields_schemacCs2|jdkr|�d�S|jdkrdSt|j�dS)aWhether the field should be included in the generated JSON schema.

        Args:
            field: The schema for the field itself.

        Returns:
            `True` if the field should be included in the generated JSON schema, `False` otherwise.
        r9�serialization_excluder8TN)r�rsr)rur�rErErFr�Ds

	
z#GenerateJsonSchema.field_is_present�Pcore_schema.ModelField | core_schema.DataclassField | core_schema.TypedDictFieldr�cCsF|jdkr|jjr|�d�S|ddkr|�d|�S|dddkS)aYWhether the field should be marked as required in the generated JSON schema.
        (Note that this is irrelevant if the field is not present in the JSON schema.).

        Args:
            field: The schema for the field itself.
            total: Only applies to `TypedDictField`s.
                Indicates if the `TypedDict` this field belongs to is total, in which case any fields that don't
                explicitly specify `required=False` are required.

        Returns:
            `True` if the field should be marked as required in the generated JSON schema, `False` otherwise.
        r9r4r�ztyped-dict-fieldr�ryr�)r�r#�+json_schema_serialization_defaults_requiredrs)rur�r�rErErFr�Vs
z$GenerateJsonSchema.field_is_required�core_schema.DataclassArgsSchemacsB�fdd�|dD�}�jdkr|���|�dg�����|�S)z�Generates a JSON schema that matches a schema that defines a dataclass's constructor arguments.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        cs.g|]}��|�r|d�j|dd�|f�qS)r�Tr1r�r�r}rErFr~xs��z<GenerateJsonSchema.dataclass_args_schema.<locals>.<listcomp>r�r9r�)r�r�r�rsr�)ruryr�rEr}rF�dataclass_args_schemaos
	�

z(GenerateJsonSchema.dataclass_args_schema�core_schema.DataclassSchemacCs�ddlm}|d}t|dtdi��}|j�|��|�|d���}Wd�n1s-wY|�|||�||�r@d}n
|j	durGdnt
�|j	�}|rS||d<|S)	z�Generates a JSON schema that matches a schema that defines a dataclass.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r")�is_builtin_dataclassrY�__pydantic_config__r1ryNr[)�_internal._dataclassesr:r�rr�r�r�r�r�rDr^r_)ruryr:rYr�r�r[rErErF�dataclass_schema�s	�z#GenerateJsonSchema.dataclass_schema�core_schema.ArgumentsSchemacCs�|�di��d�}|d}dd�|D�}dd�|D�}dd�|D�}|�d�}|�d	�}|r>|o3|}	|	r>|�|||�S|oC|}
|
rN|�|||�S|s`|oU|}	|	r`|�|||�Std
��)z�Generates a JSON schema that matches a schema that defines a function's arguments.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r��'pydantic_js_prefer_positional_arguments�arguments_schemacS�g|]}|�d�dkr|�qS)r��keyword_onlyr��rZ�arErErFr~�r\z7GenerateJsonSchema.arguments_schema.<locals>.<listcomp>cSsg|]}|�d�dvr|�qS)r�>N�positional_or_keywordr�rCrErErFr~�r\cSrA)r��positional_onlyr�rCrErErFr~�r\�var_args_schema�var_kwargs_schemazfUnable to generate JSON schema for arguments validator with positional-only and keyword-only arguments)rs�p_arguments_schema�kw_arguments_schemar.)rury�prefer_positional�	arguments�kw_only_arguments�kw_or_p_arguments�p_only_argumentsrGrH�positional_possible�keyword_possiblerErErFr@�s*	

�z#GenerateJsonSchema.arguments_schemarL�$list[core_schema.ArgumentsParameter]rH�CoreSchema | Nonec
Cs�i}g}|D](}|�|�}|�|d���}|�|�|d<|||<|dddkr.|�|�qd|d�}|r:||d<|rI|�|�}	|	rG|	|d<|Sd	|d<|S)
z�Generates a JSON schema that matches a schema that defines a function's keyword arguments.

        Args:
            arguments: The core schema.

        Returns:
            The generated JSON schema.
        ryrZr�r�r�r�r�r�F)�get_argument_namer�r�rra)
rurLrHr�r��argumentr��argument_schemar��additional_properties_schemarErErFrJ�s(

�

�z&GenerateJsonSchema.kw_arguments_schemarGc
Cs�g}d}|D](}|�|�}|�|d���}|�|�|d<|�|�|dddkr.|d7}qddi}|r9||d<|r?||d	<|rN|�|�}	|	rL|	|d
<|St|�|d<|S)z�Generates a JSON schema that matches a schema that defines a function's positional arguments.

        Args:
            arguments: The core schema.

        Returns:
            The generated JSON schema.
        rryrZr�r�r"rTr�r�r�r�)rTr�r�rrarX)
rurLrG�prefix_items�	min_itemsrUr�rVr�rlrErErFrI�s,

�
�z%GenerateJsonSchema.p_arguments_schemarU�core_schema.ArgumentsParametercCs0|d}|jr|�d�}t|t�r|}|S	|S)z�Retrieves the name of an argument.

        Args:
            argument: The core schema.

        Returns:
            The name of the argument.
        r�r�)r�rsr�r�)rurUr�r�rErErFrTs	

�z$GenerateJsonSchema.get_argument_name�core_schema.CallSchemacCr�)z�Generates a JSON schema that matches a schema that defines a function call.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r@r�rrErErF�call_schema$r�zGenerateJsonSchema.call_schema�core_schema.CustomErrorSchemacCr�)z�Generates a JSON schema that matches a schema that defines a custom error.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        ryr�rrErErF�custom_error_schema/r�z&GenerateJsonSchema.custom_error_schema�core_schema.JsonSchemacCs6|�d�pt��}|�|�}|jdkrdd|d�S|S)z�Generates a JSON schema that matches a schema that defines a JSON object.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        ryr8r1zapplication/json)r��contentMediaType�
contentSchema)rsrrr�r�)rury�content_core_schema�content_json_schemarErErFr�:s
	

zGenerateJsonSchema.json_schema�core_schema.UrlSchemacC�"dddd�}|�|||jj�|S)z�Generates a JSON schema that matches a schema that defines a URL.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r1�urir"�r�r8�	minLength�rrr1rrErErF�
url_schemaKs	zGenerateJsonSchema.url_schema�core_schema.MultiHostUrlSchemacCre)z�Generates a JSON schema that matches a schema that defines a URL that can be used with multiple hosts.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r1zmulti-host-urir"rgrirrErErF�multi_host_url_schemaXs
z(GenerateJsonSchema.multi_host_url_schema�core_schema.UuidSchemacCr=)z�Generates a JSON schema that matches a UUID.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r1�uuidr7rErrErErF�uuid_schemafr@zGenerateJsonSchema.uuid_schema�core_schema.DefinitionsSchemacCsp|dD],}z|�|�Wqty0}zt|d�}||j|�||jf�<WYd}~qd}~ww|�|d�S)z�Generates a JSON schema that matches a schema that defines a JSON object with definitions.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        rSrpNry)r�r.rGr��get_defs_refr�)rury�
definitionr�r�rErErFrfqs	��z%GenerateJsonSchema.definitions_schema�%core_schema.DefinitionReferenceSchemacCst|d�}|�|�\}}|S)z�Generates a JSON schema that matches a schema that references a definition.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        �
schema_ref)rGr�)ruryr�r�r�rErErF�definition_ref_schema�s	z(GenerateJsonSchema.definition_ref_schema�Vcore_schema.SerSchema | core_schema.IncExSeqSerSchema | core_schema.IncExDictSerSchema�JsonSchemaValue | NonecCst|d}|dks|dkr|�d�}|dur|�|�SdS|dks$|dkr+|�t���S|ddkr8|�|d	�SdS)
z�Generates a JSON schema that matches a schema that defines a serialized object.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r�r�z
function-wraprNr8z	to-string�modelry)rsr�r-r)rury�schema_typerrErErFr��s

�zGenerateJsonSchema.ser_schema�core_schema.ComplexSchemacCr
)a�Generates a JSON schema that matches a complex number.

        JSON has no standard way to represent complex numbers. Complex number is not a numeric
        type. Here we represent complex number as strings following the rule defined by Python.
        For instance, '1+2j' is an accepted complex string. Details can be found in
        [Python's `complex` documentation][complex].

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r�r1rErrErErF�complex_schema�sz!GenerateJsonSchema.complex_schemacCs|���dd���S)z�Retrieves a title from a name.

        Args:
            name: The name to retrieve a title from.

        Returns:
            The title.
        r�� )rZr��strip�rur�rErErFr�s	z&GenerateJsonSchema.get_title_from_namecCs�t�|�r|ddkr|d}n|d}|�|�St�|�rH|�d�r%dS|ddvr2|�|d�St�|�r>|�|d�S|ddkrFdSd	Std
|����)a�Returns true if a field with the given schema should have a title set based on the field name.

        Intuitively, we want this to return true for schemas that wouldn't otherwise provide their own title
        (e.g., int, float, str), and false for those that would (e.g., BaseModel subclasses).

        Args:
            schema: The schema to check.

        Returns:
            `True` if the field should have a title set, `False` otherwise.
        r�rrryrpF>r�r�rSzdefinition-refTr�)r%r�r�r�rs�is_function_with_inner_schemar.)rury�field_schemarErErFr��s 





z,GenerateJsonSchema.field_title_should_be_setcCst�dd|��dd�S)z�Normalizes a name to be used as a key in a dictionary.

        Args:
            name: The name to normalize.

        Returns:
            The normalized name.
        z[^a-zA-Z0-9.\-_]r�r��__)�re�subr�r~rErErF�normalize_name�s	z!GenerateJsonSchema.normalize_namer��CoreModeRefrHcCs|\}}t�d|�}dd�|D�}d�|�}dd�|D�}d�|�}t|}t|�|��}t|�|�d|���}	t|�|��}
t|
�d|���}t|�|��}|j�|�}
|
durm|j|
d7<|j|
}
|j|<t|
�d	|
���}t|�d	|
���}||	|
|||g|j	|<|S)
z�Override this method to change the way that definitions keys are generated from a core reference.

        Args:
            core_mode_ref: The core reference.

        Returns:
            The definitions key.
        z([\][,])cSsg|]
}|�dd�d�qS)�:r"r)�rsplitrYrErErFr~sz3GenerateJsonSchema.get_defs_ref.<locals>.<listcomp>�cSsg|]	}t�dd|��qS)z(?:[^.[\]]+\.)+((?:[^.[\]]+))z\1)r�r�rYrErErFr~r�r�Nr"r�)
r��split�joinr<rHr�r�rsr�r�)rur�r�r��
components�core_ref_no_id�	short_ref�
mode_titler��	name_mode�module_qualname�module_qualname_mode�module_qualname_id�occurrence_index�module_qualname_occurrence�module_qualname_occurrence_moderErErFrq�s4



�	zGenerateJsonSchema.get_defs_refr�rG�tuple[DefsRef, JsonSchemaValue]cCs�||jf}|j�|�}|dur|j|}|d|ifS|�|�}||j|<||j|<t|jj|d��}||j|<||j	|<d|i}||fS)a�This method wraps the get_defs_ref method with some cache-lookup/population logic,
        and returns both the produced defs_ref and the JSON schema that will refer to the right definition.

        Args:
            core_ref: The core reference to get the definitions reference for.

        Returns:
            A tuple of the definitions reference and the JSON schema that will refer to it.
        Nr��rx)
r�r�rsr�rqr�rIr�r8r�)rur�r��maybe_defs_refr�rhr�rErErFr�$s







z,GenerateJsonSchema.get_cache_defs_ref_schemacCsld|vr4|��}|�t|d��}|dur|St|���D]\}}|dkr&q||vr3|||kr3||=q|S)z�Remove any sibling keys that are redundant with the referenced schema.

        Args:
            json_schema: The schema to remove redundant sibling keys from.

        Returns:
            The schema with redundant sibling keys removed.
        r�N)r�r�rIr`r�)rur��referenced_json_schemarrrErErFr@s	�z'GenerateJsonSchema.handle_ref_overridesr�rIcCsPz|j|}||jvr|j|�|j�|d�WSty'|�d�r&YdS�w)N�zhttp://zhttps://)r�r�rSrs�KeyError�
startswith)rur��def_refrErErFr�[s



�z.GenerateJsonSchema.get_schema_from_definitions�dftcCszddlm}m}|j}z|t|��r|n
|t|�|jd�j|dd�}Wnty2t�	d|����wtj
||j|jd�S)aEncode a default value to a JSON-serializable value.

        This is used to encode default values for fields in the generated JSON schema.

        Args:
            dft: The default value to encode.

        Returns:
            The encoded default value.
        r")�TypeAdapter�_type_has_config)r��json�r�zUnable to encode default value )�timedelta_mode�
bytes_mode)
�type_adapterr�r�r#r��config_dict�dump_pythonr/r�r�rrHr9)rur�r�r�r�r�rErErFr�fs
����z!GenerateJsonSchema.encode_defaultrr��dict[str, str]cCs*|��D]\}}||vr||||<qdS)a�Update the json_schema with the corresponding validations specified in the core_schema,
        using the provided mapping to translate keys in core_schema to the appropriate keys for a JSON schema.

        Args:
            json_schema: The JSON schema to update.
            core_schema: The core schema to get the validations from.
            mapping: A mapping from core_schema attribute names to the corresponding JSON schema attribute names.
        N)r�)rur�rr��core_key�json_schema_keyrErErFr�s
��z*GenerateJsonSchema.update_with_validationsc@sJeZdZdZdddddd�Zdd	d
�Zdd	dd�Zd
dd
�Zddd
�ZdS)z%GenerateJsonSchema.ValidationsMappingagThis class just contains mappings from core_schema attribute names to the corresponding
        JSON schema attribute names. While I suspect it is unlikely to be necessary, you can in
        principle override this class in a subclass of GenerateJsonSchema (by inheriting from
        GenerateJsonSchema.ValidationsMapping) to change these mappings.
        �
multipleOf�maximum�minimum�exclusiveMaximum�exclusiveMinimum)r&r'r(r)r*rh�	maxLength)�
min_length�
max_lengthr2)r�r�r2r�r��
minProperties�
maxPropertiesN)	rArBrCrDrr:r1rTr�rErErErFr�s*����
�r�schemas�list[JsonSchemaValue]cCs`g}|D]}t|�dkrd|vr|�|d�q|�|�qt|�}t|�dkr,|dSd|iS)Nr"r+r)rXr�rarb)rur�r]ryrErErFr��sz&GenerateJsonSchema.get_flattened_anyof�dict[JsonRef, int]cs$t��d���fdd���|��S)	zKGet all values corresponding to the key '$ref' anywhere in the json_schema.ryrrUrcs�t|t�rbd|vrNt|d�}t|t�sdS|�v}�|d7<|r&dSz�j|}|�jvr6�j|���j|�WntyM|�d�sK�Ynw|�	�D]
\}}|dkr[qR�|�qRdSt|t
�rp|D]}�|�qidSdS)Nr�r"r��examples)r�r�rIr�r�r�rSr�r�r�r`)ryr��already_visitedrhrr��_add_json_refs�	json_refsrurErFr��s:





��
�

�z>GenerateJsonSchema.get_json_ref_counts.<locals>._add_json_refsN)ryrrUr)r	)rur�rEr�rFr��sz&GenerateJsonSchema.get_json_ref_counts�
error_infocCstd|����)Nz!Cannot generate a JsonSchema for )r.)ruryr�rErErFrd�rwz1GenerateJsonSchema.handle_invalid_for_json_schema�kind�JsonSchemaWarningKind�detailcCs(|�||�}|durt�|t�dSdS)zfThis method simply emits PydanticJsonSchemaWarnings based on handling in the `warning_message` method.N)�render_warning_messager{r|r@)rur�r�r�rErErFr��s�zGenerateJsonSchema.emit_warningcCs||jvrdS|�d|�d�S)amThis method is responsible for ignoring warnings as desired, and for formatting the warning messages.

        You can override the value of `ignored_warning_kinds` in a subclass of GenerateJsonSchema
        to modify what warnings are generated. If you want more control, you can override this method;
        just return None in situations where you don't want warnings to be emitted.

        Args:
            kind: The kind of warning to render. It can be one of the following:

                - 'skipped-choice': A choice field was skipped because it had no valid choices.
                - 'non-serializable-default': A default value was skipped because it was not JSON-serializable.
            detail: A string with additional details about the warning.

        Returns:
            The formatted warning message, or `None` if no warning should be emitted.
        Nz [�])r�)rur�r�rErErFr��s
z)GenerateJsonSchema.render_warning_messagerLcCsJi}|j��D]}|D]}t|jj|d��}|||<qqt�|j||j�S)Nr�)r�r�rIr�r8rLrorS)rurQ�	defs_refsrhr�rErErFr��s
�
�z/GenerateJsonSchema._build_definitions_remappingcs�t��t|�}|r;|��}z|j|}|�vrWq��|�|�t|j|��Wnty8|�d�s6�Ynw|s	�fdd�|j�	�D�|_dS)Nr�csi|]\}}|�vr||�qSrErEr��visited_defs_refsrErFr�	r\zCGenerateJsonSchema._garbage_collect_definitions.<locals>.<dictcomp>)
�set�_get_all_json_refsr�r��addr�rSr�r�r�)rury�unvisited_json_refs�
next_json_ref�
next_defs_refrEr�rFr�		s"


���z/GenerateJsonSchema._garbage_collect_definitions)r�r�r�r�)rUr�)rUr�)rUr�)r�r�rUr�)r8)ryrr�r�rUr�)ryr3rUr�rr)r�r�r�r�rUr�)r�rr�r�rUr)ryrrUr�)ryrrUr�)ryr	rUr�)ryr
rUr�)ryrrUr�)ryr"rUr�)ryr%rUr�)ryr0rUr�)ryr3rUr�)ryr<rUr�)ryrArUr�)ryrDrUr�)ryrFrUr�)ryrJrUr�)ryrXrUr�)ryrbrUr�)ryrfrUr�)ryrhrUr�)ryrjrUr�)ryrtrUr�)ryr�rUr�)ryr�rUr�)ryr�rUr�)ryr�rUr�)ryr�rUr�)ryr�rUr�)ryr�rUr�)ryr�rUr�)ryr�rUr�)ryr�rUr�)ryr�rUr�)ryr�rUr�)ryr�rUr�)ryr�r�r�rUr�)ryr�rUr�)ryr�rUr�)ryr�rUr�)ryr�rUr�)r�r�rUr�)r�r�rUr�)r�r2r�r�rUr�)ryrrUr�)ryr
rUr�)ryrrUr�)ryrrUr�)ryrrUr�)r�r�rYrr�r1rUr)r�r�rUr�)ryr0rUr�)r�r2rUr�)r�r5r�r�rUr�)ryr7rUr�)ryr9rUr�)ryr>rUr�)rLrRrHrSrUr�)rLrRrGrSrUr�)rUrZrUr�)ryr[rUr�)ryr]rUr�)ryr_rUr�)ryrdrUr�)ryrkrUr�)ryrmrUr�)ryrprUr�)ryrsrUr�)ryrvrUrw)ryrzrUr�)r�r�rUr�)ryr3rUr�)r�r�rUrH)r�rGrUr�)r�rIrUrw)r�rrUr)r�r�rrr�r�rUr)r�r�rUr�)r�r�rUr�)ryr3r�r�rUr�)r�r�r�r�rUr)r�r�r�r�rUr�)rUrL)ryr�rUr)krArBrCrD�schema_dialectr�r��DEFAULT_REF_TEMPLATEr��propertyr#r�r�r�r�r�r�r�rrrrr r$r/r-r;r?rCrErIrWrarergrirprrr~r�r}r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r	rr
rrr�r�r3r�r�r8r=r@rJrIrTr\r^r�rjrlrorfrur�r{rr�r�rqr�rr�r�rrr�r�rdr�r�r�r�rErErErFr��s�
 $11!

"$


		#.>%-!G$%*

#0 "r�Tr8rY�)type[BaseModel] | type[PydanticDataclass]r�r�r�r��schema_generator�type[GenerateJsonSchema]r�r�rU�dict[str, Any]cCsfddlm}|||d�}t|jtj�r|j��||ur td��t|jtj�r+Jd��|j|j|d�S)a�Utility function to generate a JSON Schema for a model.

    Args:
        cls: The model class to generate a JSON Schema for.
        by_alias: If `True` (the default), fields will be serialized according to their alias.
            If `False`, fields will be serialized according to their attribute name.
        ref_template: The template to use for generating JSON Schema references.
        schema_generator: The class to use for generating the JSON Schema.
        mode: The mode to use for generating the JSON Schema. It can be one of the following:

            - 'validation': Generate a JSON Schema for validating data.
            - 'serialization': Generate a JSON Schema for serializing data.

    Returns:
        The generated JSON Schema.
    r"r6�r�r�zTmodel_json_schema() must be called on a subclass of BaseModel, not BaseModel itself.zthis is a bug! please report itr�)	rr7r��__pydantic_core_schema__r(�MockCoreSchema�rebuildr�r�)rYr�r�r�r�r7�schema_generator_instancerErErF�model_json_schema	s
r�)r�rZr[r�r��models�JSequence[tuple[type[BaseModel] | type[PydanticDataclass], JsonSchemaMode]]rZr�r[�otuple[dict[tuple[type[BaseModel] | type[PydanticDataclass], JsonSchemaMode], JsonSchemaValue], JsonSchemaValue]c
Cs~|D]\}}t|jtj�r|j��q|||d�}dd�|D�}	|�|	�\}
}i}|r/||d<|r5||d<|r;||d<|
|fS)a?Utility function to generate a JSON Schema for multiple models.

    Args:
        models: A sequence of tuples of the form (model, mode).
        by_alias: Whether field aliases should be used as keys in the generated JSON Schema.
        title: The title of the generated JSON Schema.
        description: The description of the generated JSON Schema.
        ref_template: The reference template to use for generating JSON Schema references.
        schema_generator: The schema generator to use for generating the JSON Schema.

    Returns:
        A tuple where:
            - The first element is a dictionary whose keys are tuples of JSON schema key type and JSON mode, and
                whose values are the JSON schema corresponding to that pair of inputs. (These schemas may have
                JsonRef references to definitions that are defined in the second returned element.)
            - The second element is a JSON schema containing all definitions referenced in the first returned
                    element, along with the optional title and description keys.
    r�cSsg|]
\}}|||jf�qSrE)r�)rZ�mr�rErErFr~c	s�z&models_json_schema.<locals>.<listcomp>rVrZr[)r�r�r(r�r�r�)
r�r�rZr[r�r�rYr��instancer�r�rSr�rErErF�models_json_schemaC	s"
��r�)�_HashableJsonValue.r�.rr��Iterable[JsonDict]r�cCstdd�|D����S)NcSsi|]}t|�|�qSrE��_make_json_hashable)rZryrErErFr�|	rz(_deduplicate_schemas.<locals>.<dictcomp>)r`r�)r�rErErFrb{	srbr�r-cCsDt|t�rttdd�|��D���St|t�r tdd�|D��S|S)Ncss �|]\}}|t|�fVqdSrrr�rrErErFr^�	s�z&_make_json_hashable.<locals>.<genexpr>css�|]}t|�VqdSrrr�rKrErErFr^�	s�)r�r�r�r�r�r`)r�rErErFr�	s


r�c@s:eZdZUdZded<dZded<dd
d�Zddd�ZdS)�WithJsonSchemaa-Usage docs: https://docs.pydantic.dev/2.10/concepts/json_schema/#withjsonschema-annotation

    Add this as an annotation on a field to override the (base) JSON schema that would be generated for that field.
    This provides a way to set a JSON schema for types that would otherwise raise errors when producing a JSON schema,
    such as Callable, or types that have an is-instance core schema, without needing to go so far as creating a
    custom subclass of pydantic.json_schema.GenerateJsonSchema.
    Note that any _modifications_ to the schema that would normally be made (such as setting the title for model fields)
    will still be performed.

    If `mode` is set this will only apply to that schema generation mode, allowing you
    to set different json schemas for validation and serialization.
    rwr�N�-Literal['validation', 'serialization'] | Noner�r�core_schema.CoreSchema�handlerr+rUr�cCs2|jp|j}||jkr||�S|jdurt�|jSrr)r�r�r)rurr�r�rErErF�__get_pydantic_json_schema__�	s

z+WithJsonSchema.__get_pydantic_json_schema__r�cC�tt|j��Srr��hashr�r�r}rErErF�__hash__�	rwzWithJsonSchema.__hash__�rr�r�r+rUr��rUr�)rArBrCrDr�r�r�r�rErErErFr��	s


r�c@s\eZdZdZeed�	ddd
d���Zeddd
d��Z	dddd�Zddd�Zddd�ZdS) �ExamplesaAdd examples to a JSON schema.

    If the JSON Schema already contains examples, the provided examples
    will be appended.

    If `mode` is set this will only apply to that schema generation mode,
    allowing you to add different examples for validation and serialization.
    zeUsing a dict for `examples` is deprecated since v2.9 and will be removed in v3.0. Use a list instead.Nr�r�r�r�rUrcC�dSrrrE�rur�r�rErErFr��	szExamples.__init__�	list[Any]cCr�rrrEr�rErErFr��	s�dict[str, Any] | list[Any]cCs*t|t�r
tjdtdd�||_||_dS)Nz>Using a dict for `examples` is deprecated, use a list instead.rwrx)r�r�r{r|r!r�r�r�rErErFr��	s
�
rr�r�r+r�cCs|jp|j}||�}||jkr|S|�d�}|dur!t|j�|d<t|t�rNt|jt�rCt�dt	�tdd�|�
�D�|j�|d<nti|�|j��|d<t|t�r�t|jt�rdt||j�|d<|St|jt�r�t�dt	�t|dd�|j�
�D��|d<|S)Nr�z�Updating existing JSON Schema examples of type dict with examples of type list. Only the existing examples values will be retained. Note that dict support for examples is deprecated and will be removed in v3.0.cS�g|]	}|D]}|�qqSrErE�rZr��exrErErFr~�	r�z9Examples.__get_pydantic_json_schema__.<locals>.<listcomp>z�Updating existing JSON Schema examples of type list with examples of type dict. Only the examples values will be retained. Note that dict support for examples is deprecated and will be removed in v3.0.cSr�rErEr�rErErFr~�	r�)r�rsrr�r�r�r`r{r|�UserWarningr�)rurr�r�r�r�rErErFr��	s<


�
�
���z%Examples.__get_pydantic_json_schema__r�cCr�rrr�r}rErErFr��	rwzExamples.__hash__rr)r�r�r�r�rUr)r�r�r�r�rUr)r�r�r�r�rUrr�r�)	rArBrCrDrrr�r�r�rErErErFr��	s	��
'r�r|r�set[JsonRef]cCs�t�}|g}|rW|��}t|t�rK|��D]4\}}|dkr#t|t�r#q|dkr4t|t�r4|�t|��qt|t�r?|�	|�qt|t�rI|�
|�qn
t|t�rU|�
|�|s|S)z6Get all the definitions references from a JSON schema.r�r�)r�r�r�r�r�r`r�r�rIrar�)r|�refs�stack�currentr�r�rErErFr��	s(



��

�r��AnyTypec@s.eZdZdZddd�Zddd
�Zddd�ZdS)�SkipJsonSchemaa!Usage docs: https://docs.pydantic.dev/2.10/concepts/json_schema/#skipjsonschema-annotation

        Add this as an annotation on a field to skip generating a JSON schema for that field.

        Example:
            ```python
            from typing import Union

            from pydantic import BaseModel
            from pydantic.json_schema import SkipJsonSchema

            from pprint import pprint

            class Model(BaseModel):
                a: Union[int, None] = None  # (1)!
                b: Union[int, SkipJsonSchema[None]] = None  # (2)!
                c: SkipJsonSchema[Union[int, None]] = None  # (3)!

            pprint(Model.model_json_schema())
            '''
            {
                'properties': {
                    'a': {
                        'anyOf': [
                            {'type': 'integer'},
                            {'type': 'null'}
                        ],
                        'default': None,
                        'title': 'A'
                    },
                    'b': {
                        'default': None,
                        'title': 'B',
                        'type': 'integer'
                    }
                },
                'title': 'Model',
                'type': 'object'
            }
            '''
            ```

            1. The integer and null types are both included in the schema for `a`.
            2. The integer type is the only type included in the schema for `b`.
            3. The entirety of the `c` field is omitted from the schema.
        r|r�rUcCst||�fSrr)r)rYr|rErErF�__class_getitem__G
rwz SkipJsonSchema.__class_getitem__rrr�r+r�cCst�rr)r)rurr�rErErFr�J
sz+SkipJsonSchema.__get_pydantic_json_schema__r�cCstt|��Srr)r�r�r}rErErFr�O
szSkipJsonSchema.__hash__N)r|r�rUr�)rrr�r+rUr�r�)rArBrCrDr�r�r�rErErErFr�
s

/
r��type[Any] | Noner1cCs0|durzt�|d�WStyYiSwiS)Nr;)r&�get_attribute_from_basesr�)rYrErErFr�S
s�r�rE)rYr�r�r�r�r�r�r�r�r�rUr�)r�r�r�r�rZr�r[r�r�r�r�r�rUr�)r�r�rUr�)r�r-rUr�)r|rrUr�)rYr�rUr1)qrD�
__future__r�_annotationsrr^rr�r�r{�collectionsrr�rrOr�typingrrrr	r
rrr
rrrrrrrr�rrrr�pydantic_core.core_schemar�typing_extensionsrrrrrr�pydantic.warningsr r!�	_internalr#r$r%r&r'r(r)r*�annotated_handlersr+r�r,r-�errorsr.r/r0r�r1�_internal._core_utilsr2r3r<r4�#_internal._schema_generation_sharedr5rr7�CoreSchemaType�CoreSchemaFieldTyper�r�r�r�r<r�r�r�r@r�rGrHrIr�rJ�	dataclass�
slots_truerLr�r�r�r�r.r�r�rbr�r�r�r�r�r�r�rErErErF�<module>s�D (
		


P[�(�3$�

	!
J<