Ë
    ¢S9iÄ  ã                   óR   — d dl mZmZ d dlmZ d dlmZmZ d dlm	Z	  G d„ de«      Z
y)é    )Úset_overrideÚwarn)ÚOpenApiSerializerExtension)ÚResolvedComponentÚbuild_basic_type)ÚOpenApiTypesc                   ó$   — e Zd ZdZdZdZd„ Zd„ Zy)ÚPydanticExtensiona™  
    Allows using pydantic models on @extend_schema(request=..., response=...) to
    describe your API.

    We only have partial support for pydantic's version of dataclass, due to the way they
    are designed. The outermost class (the @extend_schema argument) has to be a subclass
    of pydantic.BaseModel. Inside this outermost BaseModel, any combination of dataclass
    and BaseModel can be used.
    zpydantic.BaseModelTc                 ó\   — t        | j                  dd«       | j                  j                  S )NÚsuppress_collision_warningT)r   ÚtargetÚ__name__)ÚselfÚauto_schemaÚ	directions      ús/home/cursorai/projects/telegram-earn/backend/venv/lib/python3.12/site-packages/drf_spectacular/contrib/pydantic.pyÚget_namezPydanticExtension.get_name   s%   € ô 	�T—[‘[Ð">ÀÔEØ�{‰{×#Ñ#Ð#ó    c                 ód  — 	 ddl m}  || j                  dd¬«      }|j                  di «      j                  «       D ]=  \  }}t        |t        j                  ||¬«      }|j                  j                  |«       Œ? |S # t        $ r' t        d«       t	        t
        j                  «      cY S w xY w)	Nr   )Úmodel_json_schemaz>Only pydantic >= 2 is supported. defaulting to generic object.z#/components/schemas/{model}Úserialization)Úref_templateÚmodez$defs)ÚnameÚtypeÚobjectÚschema)Úpydantic.json_schemar   ÚImportErrorr   r   r   ÚOBJECTr   ÚpopÚitemsr   ÚSCHEMAÚregistryÚregister_on_missing)r   r   r   r   r   Úsub_nameÚ
sub_schemaÚ	components           r   Úmap_serializerz PydanticExtension.map_serializer   sª   € ð	9Ý>ñ
 # 4§;¡;Ð=[ÐbqÔrˆð %+§J¡J¨w¸Ó$;×$AÑ$AÖ$CÑ ˆH�jÜ)ØÜ&×-Ñ-ØØ!ô	ˆIð × Ñ ×4Ñ4°YÕ?ð %Dð ˆøô! ò 	9ÜÐQÔRÜ#¤L×$7Ñ$7Ó8Ò8ð	9ús   ‚A? Á?-B/Â.B/N)r   Ú
__module__Ú__qualname__Ú__doc__Útarget_classÚmatch_subclassesr   r)   © r   r   r
   r
      s   „ ñð (€LØÐò$ór   r
   N)Údrf_spectacular.drainager   r   Údrf_spectacular.extensionsr   Údrf_spectacular.plumbingr   r   Údrf_spectacular.typesr   r
   r/   r   r   Ú<module>r4      s   ðß 7Ý Aß HÝ .ô+Ð2õ +r   