PATH:
opt
/
hc_python
/
lib
/
python3.12
/
site-packages
/
pydantic
/
_internal
/
__pycache__
� ���g� � �� � d Z ddlmZ ddlmZmZmZ ddlmZ ddl m Z ddlmZm Z er%ddlmZmZ d d lmZ d dlmZ eee gef Zeegef Z G d� d e � Z G d� de� Zy)zATypes and utility functions used by various other internal tools.� )�annotations)� TYPE_CHECKING�Any�Callable)�core_schema)�Literal� )�GetCoreSchemaHandler�GetJsonSchemaHandler)�GenerateJsonSchema�JsonSchemaValue� )�CoreSchemaOrField)�GenerateSchemac �( � e Zd ZdZdd�Zdd�Zdd�Zy) �GenerateJsonSchemaHandleraS JsonSchemaHandler implementation that doesn't do ref unwrapping by default. This is used for any Annotated metadata so that we don't end up with conflicting modifications to the definition schema. Used internally by Pydantic, please do not rely on this implementation. See `GetJsonSchemaHandler` for the handler API. c �^ � || _ |xs |j | _ |j | _ y �N)�generate_json_schema�generate_inner�handler�mode)�selfr �handler_overrides �[/opt/hc_python/lib/python3.12/site-packages/pydantic/_internal/_schema_generation_shared.py�__init__z"GenerateJsonSchemaHandler.__init__ s* � �$8��!�'�N�+?�+N�+N���(�-�-�� � c �$ � | j |� S r )r )r r s r �__call__z"GenerateJsonSchemaHandler.__call__$ s � ��|�|�K�(�(r c �t � d|vr|S |d }| j j |� }|�t d|� d�� �|S )aj Resolves `$ref` in the json schema. This returns the input json schema if there is no `$ref` in json schema. Args: maybe_ref_json_schema: The input json schema that may contains `$ref`. Returns: Resolved json schema. Raises: LookupError: If it can't find the definition for `$ref`. z$ref�Could not find a ref for �K. Maybe you tried to call resolve_ref_schema from within a recursive model?)r �get_schema_from_definitions�LookupError)r �maybe_ref_json_schema�ref�json_schemas r �resolve_ref_schemaz,GenerateJsonSchemaHandler.resolve_ref_schema'