Files
cms-website/.deps_siteforge_v812/starlette/__pycache__/schemas.cpython-312.pyc
T

48 lines
6.9 KiB
Plaintext
Raw Normal View History

Ë
ðÅÙj0ãó
—ddlmZddlZddlZddlmZddlmZmZddl m
Z
ddl m Z ddl
mZmZmZmZ ddlZGd„d e «ZGd
„d e«Zej,d «ZGd
„d«ZGd„de«Zy#e$rdZYŒGwxYw)é)Ú annotationsN)ÚCallable)ÚAnyÚ
NamedTuple)ÚRequest)ÚResponse)Ú BaseRouteÚHostÚMountÚRoutecó—eZdZdZdd„Zy)ÚOpenAPIResponsezapplication/vnd.oai.openapicó–—t€Jd«‚t|t«sJd«‚tj|d¬«j d«S)Nz2`pyyaml` must be installed to use OpenAPIResponse.z<The schema passed to OpenAPIResponse should be a dictionary.F)Údefault_flow_stylezutf-8)ÚyamlÚ
isinstanceÚdictÚdumpÚencode)ÚselfÚcontents úUC:\Users\30997\AppData\Local\Temp\pip-target-6g32zz5s\lib\python\starlette/schemas.pyÚrenderzOpenAPIResponse.rendersF€ÜÐÐUÐ!UÓUÐܘ'¤4Ô(ÐhÐ*hÓhÐ(Ü�y‰y˜°UÔ;×BÑBÀ7ÓKÐKóN)rrÚreturnÚbytes)Ú__name__Ú
__module__Ú __qualname__Ú
media_typer©rrrrs
„Ø.€JôLrrcó,—eZdZUded<ded<ded<y)Ú EndpointInfoÚstrÚpathÚ http_methodúCallable[..., Any]ÚfuncN)rrrÚ__annotations__r!rrr#r#s…Ø
ƒIØÓØ
Ôrr#z:\w+}có4—eZdZdd„Zdd„Zd d„Zd
d„Zd d„Zy) ÚBaseSchemaGeneratorcó—t«‚©N)ÚNotImplementedError)rÚroutess rÚ
get_schemazBaseSchemaGenerator.get_schema%s €Ü!Ó#Ð#rc
ó(—g}|D�]}t|ttz«r©|jxsg}t|t«r|j |j
«}nd}|j
|«D�cgc]?}tdj||j
f«|j|j¬«‘ŒA}}|j|«ŒÄt|t«r |jsŒátj|j «stj"|j «rm|j |j
«}|j$xsdgD]<}|dk(rŒ |j't||j)«|j ««Œ>�ŒŒ|j |j
«}dD]Y}t+|j |«sŒt-|j |«}|j't||j)«|««Œ[�Œ|Scc}w)a

Given the routes, yields the following information:
- path
eg: /users/
- http_method
one of 'get', 'post', 'put', 'patch', 'delete', 'options'
- func
method ready to extract the docstring
Ú)r%r&r(ÚGETÚHEAD)ÚgetÚpostÚputÚpatchÚdeleteÚoptions)rr r
r/Ú_remove_converterr%Ú
get_endpointsr#Újoinr&r(Úextendr Úinclude_in_schemaÚinspectÚ
isfunctionÚendpointÚismethodÚmethodsÚappendÚlowerÚhasattrÚgetattr) rr/Úendpoints_infoÚrouter%Ú sub_endpointÚ
sub_endpointsÚmethodr(s rr<z!BaseSchemaGenerator.get_endpoints(sÀ€ð.0ˆäˆEܘ%¤¬¡Ô.ØŸ™Ò+¨�ܘe¤UÔ+Ø×1Ñ1°%·*±*Ó=‘Dà�Dð)-×(:Ñ(:¸6Ô(Bó
!ñ )C˜ ô !ØŸW™W d¨L×,=Ñ,=Ð%>Ó?Ø$0×$<Ñ$<Ø)×.Ñ.öð
)Cð
ð!ð×%Ñ% mÕ4ä ¤uÔ-°U×5LÒ5LØä×#Ñ# E§N¡NÔ3´w×7GÑ7GÈÏÉÔ7WØ×-Ñ-¨e¯j©jÓ9�Ø#Ÿm™mÒ6°¨wÒ6�FØ Ò'Ø Ø"×)Ñ)¬,°t¸V¿\¹\»^ÈUÏ^É^Ó*\Õ]ò7ð
×-Ñ-¨e¯j©jÓ9�ÛR�FÜ" 5§>¡>°6Ô:Ø Ü" 5§>¡>°6Ó:�DØ"×)Ñ)¬,°t¸V¿\¹\»^ÈTÓ*RÕSò Sð9ðDÐùò7!sÁ1AHcó.—tjd|«S)zì
Remove the converter from the path.
For example, a route like this:
Route("/users/{id:int}", endpoint=get_user, methods=["GET"])
Should be represented as `/users/{id}` in the OpenAPI schema.
Ú})Ú_remove_converter_patternÚsub)rr%s rr;z%BaseSchemaGenerator._remove_converterYs€ô)×,Ñ,¨S°$Ó7Ð7rcó¶—|j}|siSt€Jd«‚|jd«d}tj|«}t |t
«siS|S)z`