Ë ç§þ"â[´Õãó„—ddlZddlZddlZddlmZmZmZddlmZ ddl m Z ddl m Z  ddlZeej j«sdZddlmZdZGd„d e«ZGd „d e«ZGd „d e«Zd„Zdd„Zdedddddfd„Zd„Z dd„Z dd„Z dd„Zd„Z d„Z!d„Z"y#e$rdZYŒrwxYw)éN)ÚMappingÚMutableMappingÚSequence)Úparse)Úunquote)Úurlopen)Ú LazyProxyz1.1.0có —eZdZdd„Zd„Zd„Zy)Ú JsonRefErrorNcóf—||_||_||_||_||_|x|_|_y©N)ÚmessageÚ referenceÚuriÚbase_uriÚpathÚcauseÚ __cause__)Úselfrrrrrrs ú,/usr/lib/python3.12/site-packages/jsonref.pyÚ__init__zJsonRefError.__init__s3€ØˆŒ Ø"ˆŒØˆŒØ ˆŒ ؈Œ Ø&+Ð+ˆŒ �T•^ócóP—d|jj›d|j›d�S)NÚ<ú: Ú>)Ú __class__Ú__name__r©rs rÚ__repr__zJsonRefError.__repr__ s�Ø!Ÿ^™^×4Ó4°d·l³lÐCÐCrcó,—t|j«Sr )Ústrrrs rÚ__str__zJsonRefError.__str__#s€Ü�4—<‘<Ó Ð r)Úr$©N)rÚ __module__Ú __qualname__rr r#r%rrr r s„ó,òDó!rr cóx—eZdZdZdZe d d„«Z d d„Zed„«Z ed„«Z d„Z d „Z dd „Z d „Zy)ÚJsonRefzc A lazy loading proxy to the dereferenced data pointed to by a JSON Reference object. )Ú __reference__Ncó"—t|||||¬«S)a .. deprecated:: 0.4 Use :func:`replace_refs` instead. Returns a deep copy of `obj` with all contained JSON reference objects replaced with :class:`JsonRef` instances. :param obj: If this is a JSON reference object, a :class:`JsonRef` instance will be created. If `obj` is not a JSON reference object, a deep copy of it will be created with all contained JSON reference objects replaced by :class:`JsonRef` instances :param base_uri: URI to resolve relative references against :param loader: Callable that takes a URI and returns the parsed JSON (defaults to global ``jsonloader``) :param jsonschema: Flag to turn on `JSON Schema mode `_. 'id' keyword changes the `base_uri` for references contained within the object :param load_on_repr: If set to ``False``, :func:`repr` call on a :class:`JsonRef` object will not cause the reference to be loaded if it hasn't already. (defaults to ``True``) )rÚloaderÚ jsonschemaÚ load_on_repr)Ú replace_refs)ÚclsÚobjrr,r-r.s rr/zJsonRef.replace_refs0s €ô6Ø ØØØ!Ø%ô  ð rc ó—t|jd«t«std|z«‚||_||_|xst |_||_||_ ||_ ||_ ||_ |j€t«|_ yy)Nú$refz%Not a valid json reference object: %s)Ú isinstanceÚgetr"Ú ValueErrorr*rÚ jsonloaderr,r-r.Ú merge_propsrÚstoreÚURIDict) rÚrefobjrr,r-r.r8Ú_pathÚ_stores rrzJsonRef.__init__Ss€€ô˜&Ÿ*™* VÓ,¬cÔ2ÜÐDÀvÑMÓNÐ NØ#ˆÔØ ˆŒ ØÒ*¤ ˆŒ Ø$ˆŒØ(ˆÔØ&ˆÔ؈Œ ؈Œ Ø �:‰:Ð Ü ›ˆD�Jð rc ó²—t|j|j|j|j|j |j |j¬«S)N)rr,r-r.r8rr9)Údictrr,r-r.r8rr9rs rÚ _ref_kwargszJsonRef._ref_kwargsksD€äØ—]‘]Ø—;‘;Ø—‘Ø×*Ñ*Ø×(Ñ(Ø—‘Ø—*‘*ô ð rcó\—tj|j|jd«S)Nr3)ÚurlparseÚurljoinrr*rs rÚfull_urizJsonRef.full_uriws$€ä×Ñ § ¡ ¨t×/AÑ/AÀ&Ñ/IÓJÐJrcóÔ—tj|j«\}}||jvr0 |j |«}t|fii|j¥|ddœ¥¤Ž}n|j|}|j||«}||ur|j d«‚t|d«r |j}|jr`t!|t"«rPt%|j&«dkDr8i|¥|j&j)«D��cic]\}}|dk7sŒ ||“Œc}}¥}|S#t $r;}|j |jj›dt|«›�|¬«|‚d}~wwxYwcc}}w) Nr©rF)rÚ recursingz$Reference refers directly to itself.Ú __subject__ér3)rBÚ urldefragrDr9r,Ú ExceptionÚ_errorrrr"Ú _replace_refsr@Úresolve_pointerÚhasattrrHr8r4rÚlenr*Úitems)rrÚfragmentÚbase_docÚeÚresultÚkÚvs rÚcallbackzJsonRef.callback{sk€Ü ×*Ñ*¨4¯=©=Ó9‰ ˆˆXð �d—j‘jÑ ð ØŸ;™; sÓ+�ô %ØñØU˜t×/Ñ/ÐU¸SÈuÒUñ‰Hð—z‘z #‘ˆHØ×%Ñ% h°Ó9ˆØ �T‰>Ø—+‘+ÐDÓEÐ EÜ �6˜=Ô )Ø×'Ñ'ˆFà × Ò Ü˜6¤7Ô+Ü�D×&Ñ&Ó'¨!Ò+ðØðà$(×$6Ñ$6×$<Ñ$<Ô$>ÔNÑ$>™D˜A˜qÀ!ÀvÃ+�1�a‘4Ð$>ÒNðˆFðˆ øô/ò Ø—k‘kØ !§ ¡ × 4Ó 4´c¸!´fÐ=ÀQð"óàðûð üó*Os#²DÄ E$ÄE$Ä E!Ä&6EÅE!có�—|r)t|jd««jd«ng}|D]V}|jdd«jdd«}t |t «r t |«}||ur |j} ||}ŒX|S#t$rYŒ%wxYw#ttf$r}|jd|z|¬«|‚d}~wwxYw)zÜ Resolve a json pointer ``pointer`` within the referenced ``document``. :argument document: the referent document :argument str pointer: a json pointer URI fragment to resolve within it Ú/z~1z~0Ú~zUnresolvable JSON pointer: %rrFN) rÚlstripÚsplitÚreplacer4rÚintr6r*Ú TypeErrorÚ LookupErrorrL)rÚdocumentÚpointerÚpartsÚpartrTs rrNzJsonRef.resolve_pointerœsÝ€ñ‘ðð$ˆøô"òÙðûôœ{Ð+ò Ø—k‘kØ3°gÑ=ÀQð"óàðûð ús*Á& B ÂB BÂBÂCÂ)CÃCcó¬—dj|j|«}t||j|j|j|j |¬«S)NzError while resolving `{}`: {})rrrr)ÚformatrDr r*rr)rrrs rrLzJsonRef._errorºsI€Ø2×9Ñ9¸$¿-¹-ÈÓQˆÜØ Ø × Ñ Ø— ‘ Ø—]‘]Ø—‘Øô  ð rcóz—t|d«s |jrt|j«Sd|jzS)NÚcachez JsonRef(%r))rOr.ÚreprrHr*rs rr zJsonRef.__repr__Ås6€Ü �4˜Ô ! T×%6Ò%6ܘ×(Ñ(Ó)Ð )ؘt×1Ñ1Ñ1Ð1r)r$NFT)r$NFTFr%Nr )rr&r'Ú__doc__Ú__notproxied__Ú classmethodr/rÚpropertyr@rDrXrNrLr r%rrr)r)'s„ñð (€NààKOò  óð  ðJØØØØØØó#ð0ñ  óð  ðñKóðKòòBó<  ó2rr)có@—eZdZdZd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z y ) r:z8 Dictionary which uses normalized URIs as keys. cóH—tj|«j«Sr )rBÚurlsplitÚgeturl©rrs rÚ normalizezURIDict.normalizeÐs€Ü× Ñ  Ó%×,Ñ,Ó.Ð.rcóZ—t«|_|jj|i|¤Žyr )r?r9Úupdate)rÚargsÚkwargss rrzURIDict.__init__Ós$€Ü“VˆŒ ؈� ‰ ×ј4Ð* 6Ó*rcó>—|j|j|«Sr ©r9rtrss rÚ __getitem__zURIDict.__getitem__×s€Ø�z‰z˜$Ÿ.™.¨Ó-Ñ.Ð.rcó@—||j|j|«<yr rz)rrÚvalues rÚ __setitem__zURIDict.__setitem__Ús€Ø*/ˆ� ‰ �4—>‘> #Ó&Ò'rcó<—|j|j|«=yr rzrss rÚ __delitem__zURIDict.__delitem__Ýs€Ø �J‰J�t—~‘~ cÓ*Ñ +rcó,—t|j«Sr )Úiterr9rs rÚ__iter__zURIDict.__iter__àó€Ü�D—J‘JÓÐrcó,—t|j«Sr )rPr9rs rÚ__len__zURIDict.__len__ãs€Ü�4—:‘:‹Ðrcó,—t|j«Sr )rjr9rs rr zURIDict.__repr__ær„rN) rr&r'rkrtrr{r~r€rƒr†r r%rrr:r:Ës/„ñò/ò+ò/ò0ò,ò òó rr:c óÞ—tj|«j}|dvr@tr:tj|«}|j « |j di|¤Ž}|St|«5}t j|j«jd«fi|¤Ž}ddd«|S#t$r)tjd«|j «}Y|SwxYw#1swYSxYw)z¿ Provides a callable which takes a URI, and returns the loaded JSON referred to by that URI. Uses :mod:`requests` if available for HTTP URIs, and falls back to :mod:`urllib`. )ÚhttpÚhttpsz7requests >=1.2 required for custom kwargs to json.loadszutf-8Nr%)rBrqÚschemeÚrequestsr5Úraise_for_statusÚjsonr`ÚwarningsÚwarnrÚloadsÚreadÚdecode)rrxr‹ÚresprUÚcontents rr7r7êsØ€ô × Ñ ˜sÓ #× *Ñ *€Fà Ð"Ñ"¥xä�|‰|˜CÓ ˆð ×ÑÔð !Ø�T—Y‘YÑ( Ñ(ˆFð €Mô�SŒ\˜WÜ—Z‘Z § ¡ £× 5Ñ 5°gÓ >ÑIÀ&ÑIˆF÷ð €Møôò !Ü �M‰MÐSÔ TØ—Y‘Y“[‰Fð €Mð !ú÷ ð €MúsÁB-Á/4C"Â-.CÃCÃ"C,Fcó˜—|xsi}t|«}||vr||St|«tur||«}|r|n|}|||<t|t«r1|j «D]\}}t ||||¬«}|sŒ|||<Œ|St|t«r:t|t«s*t|«D]\}}t ||||¬«}|sŒ|||<Œ|S)N)r^Ú _processed) ÚidÚtyper)r4rrQÚ _walk_refsrr"Ú enumerate) r1Úfuncr^r—ÚoidÚrrVrWÚis rršršsÙ€àÒ!˜r€JÜ ˆS‹'€CØ ˆjÑØ˜#‰ÐÜ ˆCƒy”GÑÙ �‹IˆÙ‰a ˆØ€Jˆs�OÜ�#”wÔØ—I‘I–K‰DˆAˆqܘ1˜d¨GÀ ÔKˆAÚØ��A’ð ð €Jô �CœÔ "¬:°c¼3Ô+?ܘc–N‰DˆAˆqܘ1˜d¨GÀ ÔKˆAÚØ��A’ð#ð €Jrr$Tc ó‚—t||||||t«dd¬« }|st|d„d¬«|S|s t|d„«|S)aè Returns a deep copy of `obj` with all contained JSON reference objects replaced with :class:`JsonRef` instances. :param obj: If this is a JSON reference object, a :class:`JsonRef` instance will be created. If `obj` is not a JSON reference object, a deep copy of it will be created with all contained JSON reference objects replaced by :class:`JsonRef` instances :param base_uri: URI to resolve relative references against :param loader: Callable that takes a URI and returns the parsed JSON (defaults to global ``jsonloader``, a :class:`JsonLoader` instance) :param jsonschema: Flag to turn on `JSON Schema mode `_. 'id' or '$id' keyword changes the `base_uri` for references contained within the object :param load_on_repr: If set to ``False``, :func:`repr` call on a :class:`JsonRef` object will not cause the reference to be loaded if it hasn't already. (defaults to ``True``) :param merge_props: When ``True``, JSON reference objects that have extra keys other than '$ref' in them will be merged into the document resolved by the reference (if it is a dictionary.) NOTE: This is not part of the JSON Reference spec, and may not behave the same as other libraries. :param proxies: If `True`, references will be replaced with transparent proxy objects. Otherwise, they will be replaced directly with the referred data. (defaults to ``True``) :param lazy_load: When proxy objects are used, and this is `True`, the references will not be resolved until that section of the JSON document is accessed. (defaults to ``True``) r%F©rr,r-r.r8r9rrGcó—|jSr ©rH©ržs rÚzreplace_refs..Qó€ Q§]¢]rT)r^có—|jSr r£r¤s rr¥zreplace_refs..Sr¦r)rMr:rš) r1rr,r-r.r8ÚproxiesÚ lazy_loadrUs rr/r/sZ€ôRØ ØØØØ!ØÜ‹iØ Øô €Fñ Ü�6Ñ2¸DÕAð €MñÜ�6Ñ2Ô3Ø €Mrcóæ—tj|«\}} d} | s|s|} |r\t|t«rL|j d«xs|j d«} t| t «rtj || «}|} t|t«r:|j«D� � cic]\} } | t| |||||||| fzd¬« “Œ }} } nSt|t«rCt|t «s3t|«D�� cgc]\}} t| ||||||||fzd¬« ‘Œ}}} t|t«r2t|j d«t «rt||||||||¬«}| �||| <|Scc} } wcc} }w)Nz$idr˜Tr¡r3)rr,r-r.r8r<r=) rBrJr4rr5r"rCrQrMrr›r))r1rr,r-r.r8r9rrGÚfragÚ store_uriÚid_rVrWrŸs rrMrMWs¡€ô×'Ñ'¨Ó1�N€HˆdØ€IÙ ™ ؈ Ù”j ¤gÔ.à�g‰g�e‹nÒ- §¡¨£ ˆÜ �cœ3Ô Ü×'Ñ'¨°#Ó6ˆHØ ˆIô�#”wÔ🠙 œ ô  ñ$‘��1ð Œ}ØØ!ØØ%Ø)Ø'ØØ˜Q˜D‘[Øô ñ ð$ð ò  ô �CœÔ "¬:°c¼3Ô+?ô" #œô  ñ'‘��1ô ØØ!ØØ%Ø)Ø'ØØ˜Q˜D‘[Øö ð'ð ñ  ô �#”wÔ¤J¨s¯w©w°v«ÄÔ$DÜØ ØØØ!Ø%Ø#ØØô  ˆðÐØˆˆiÑà €Jùó_  ùó  s Â"#E'Ã7"E-c óˆ—|€tjtfi|¤Ž}tt j |fi|¤Ž|||||||¬«S)a^ Drop in replacement for :func:`json.load`, where JSON references are proxied to their referent data. :param fp: File-like object containing JSON document :param **kwargs: This function takes any of the keyword arguments from :func:`replace_refs`. Any other keyword arguments will be passed to :func:`json.load` ©rr,r-r.r8r¨r©)Ú functoolsÚpartialr7r/rŽÚload) Úfprr,r-r.r8r¨r©rxs rr²r²¢sQ€ð,€~Ü×"Ñ"¤:Ñ8°Ñ8ˆä Ü � ‰ �"Ñ˜ÑØØØØ!ØØØô ð rc óˆ—|€tjtfi|¤Ž}tt j |fi|¤Ž|||||||¬«S)aU Drop in replacement for :func:`json.loads`, where JSON references are proxied to their referent data. :param s: String containing JSON document :param **kwargs: This function takes any of the keyword arguments from :func:`replace_refs`. Any other keyword arguments will be passed to :func:`json.loads` r¯)r°r±r7r/rŽr‘) Úsrr,r-r.r8r¨r©rxs rr‘r‘ÇsQ€ð,€~Ü×"Ñ"¤:Ñ8°Ñ8ˆä Ü � ‰ �1Ñ˜ÑØØØØ!ØØØô ð rc óL—|€t}|€|}t||«|||||||¬«S)zó Load JSON data from ``uri`` with JSON references proxied to their referent data. :param uri: URI to fetch the JSON from :param **kwargs: This function takes any of the keyword arguments from :func:`replace_refs` r¯)r7r/)rrr,r-r.r8r¨r©s rÚload_urir·ìsB€ð(€~܈ØÐ؈ä Ùˆs‹ ØØØØ!ØØØô ð rc ó:—|jt|fi|¤Ž«y)au Serialize `obj`, which may contain :class:`JsonRef` objects, as a JSON formatted stream to file-like `fp`. `JsonRef` objects will be dumped as the original reference object they were created from. :param obj: Object to serialize :param fp: File-like to output JSON string :param kwargs: Keyword arguments are the same as to :func:`json.dump` N)ÚwriteÚdumps)r1r³rxs rÚdumpr»s€ð‡H�HŒU�3Ñ !˜&Ñ !Õ"rc ó†—t|jdtj««|d<tj|fi|¤ŽS)a5 Serialize `obj`, which may contain :class:`JsonRef` objects, to a JSON formatted string. `JsonRef` objects will be dumped as the original reference object they were created from. :param obj: Object to serialize :param kwargs: Keyword arguments are the same as to :func:`json.dumps` r0)Ú_ref_encoder_factoryr5rŽÚ JSONEncoderrº)r1rxs rrºrº!s7€ô)¨¯©°E¼4×;KÑ;KÓ)LÓM€Fˆ5�MÜ �:‰:�cÑ $˜VÑ $Ð$rcó&‡‡—Gˆˆfd„d‰«Š‰S)Ncó<•‡—eZdZˆˆˆfd„Zˆˆfd„Zˆˆfd„ZˆxZS)ú,_ref_encoder_factory..JSONRefEncodercóR•—t|d«r |jSt‰‰�|«S©Nr*)rOr*ÚsuperÚdefault)rÚoÚJSONRefEncoderrr0s €€€rrÅz4_ref_encoder_factory..JSONRefEncoder.default1s)ø€Ü�q˜/Ô*Ø—‘Ð&ܘ¨Ñ5°aÓ8Ð 8rcóZ•—t|d«r |j}t‰|�|g|¢­i|¤ŽSrÃ)rOr*rÄÚ _iterencode©rrÆrwrxrÇrs €€rrÉz8_ref_encoder_factory..JSONRefEncoder._iterencode7s2ø€Ü�q˜/Ô*Ø—O‘O�ܘ¨Ñ:¸1ÐN¸tÒNÀvÑNÐ NrcóZ•—t|d«r |j}t‰|�|g|¢­i|¤ŽSrÃ)rOr*rÄÚ_encoderÊs €€rrÌz4_ref_encoder_factory..JSONRefEncoder._encode=s2ø€Ü�q˜/Ô*Ø—O‘O�ܘ¨Ñ6°qÐJ¸4ÒJÀ6ÑJÐ Jr)rr&r'rÅrÉrÌÚ __classcell__)rrÇr0s@€€rrÇrÁ0sù„ö 9õ  O÷  Kñ KrrÇr%)r0rÇs`@rr½r½/sù€÷K˜ôKð$ Ðr)FN)r$NFTFTT)NNFTFTT)#r°rŽr�Úcollections.abcrrrÚurllibrrBÚ urllib.parserÚurllib.requestrrŒÚcallableÚResponseÚ ImportErrorÚ proxytypesr Ú __version__rKr r)r:r7ršr/rMr²r‘r·r»rºr½r%rrÚr×sðÛÛ Ûß=Ñ=Ý$Ý Ý"ðãá �H×%Ñ%×*Ñ*Ô +؈õ!à€ ô !�9ô !ô a2ˆiôa2ôH ˆnô ò>ó6ð2Ø ØØØØ Øó8òvHðZØ ØØØØ Øó"ðNØ ØØØØ Øó"ðNØ ØØØØ Øó"òJ #ò %óøðAòØ‚Hðúsª"B5Â5B?Â>B?