+
    P4i                      F   R t ^ RIHt ^ RIHt ^ RIHt ^ RIt^ RIt^ RIt^ RI	t	^ RI
t
 ^ RIHt ^ RIHtHt ^ RIHt ^ RIHtHt ]
P.                  ! R	]^R
7        ! R R]4      t] ! R R4      4       t] ! R R4      4       t] ! R R4      4       tR t]P>                  ! RR7      t ] PC                  RRRRRR7       ] PC                  RRRR7       ] PC                  R R!R"R#.R"R$R%7       ] PC                  R&R']R(R)7       ] PC                  R*R+R7       ] PC                  R,R-]PD                  ! R.4      R/7       ] PC                  R0R1R7       R2 t#R3 t$]PJ                  R4,          3R5 lt&]PN                  ]PP                  ]PR                  3R6 lt*R#   ] d    ^ RIHt  ELoi ; i)7z"
The ``jsonschema`` command line.
)metadata)JSONDecodeError)dedentNresolve_name)definefield)SchemaError)_RefResolvervalidator_forzThe jsonschema CLI is deprecated and will be removed in a future version. Please use check-jsonschema instead, which can be installed from https://pypi.org/project/check-jsonschema/)
stacklevelc                       ] tR t^#tRtR# )_CannotLoadFile N)__name__
__module____qualname____firstlineno____static_attributes__r       0/usr/lib/python3/dist-packages/jsonschema/cli.pyr   r   #   s    r   r   c                   x   a  ] tR t^'t o ]! 4       t]! 4       t]! 4       t]R 4       t	R t
R tR tR tR tRtV tR# )	
_Outputterc                    VR ,          R8X  d   \        VR,          4      pMVR ,          R8X  d   \        4       pV ! XW#R7      # )outputplainerror_formatpretty)	formatterstdoutstderr)_PlainFormatter_PrettyFormatter)cls	argumentsr   r    r   s   &&&& r   from_arguments_Outputter.from_arguments.   s@    X')'	.(ABIx H,(*IYvEEr   c                    \        V4      pT;_uu_ 4         \        P                  ! T4      uuRRR4       #   \         d2    T P                  T\        P                  ! 4       R 7       \        4       hi ; i  \         d2    T P                  T\        P                  ! 4       R 7       \        4       hi ; i  + '       g   i     R# ; i)pathexc_infoN)
openFileNotFoundErrorfilenotfound_errorsysr*   r   jsonloadr   parsing_error)selfr)   files   && r   r0   _Outputter.load6   s    	$:D
 T(yy T	 ! 	$###G!##	$ # (""s||~"F%''( TTs%   9 B7A8<A58<B44B77C	c                p    V P                   P                  V P                  P                  ! R/ VB 4       R # Nr   )_stderrwrite
_formatterr-   r2   kwargss   &,r   r-   _Outputter.filenotfound_errorD   &    4??==GGHr   c                p    V P                   P                  V P                  P                  ! R/ VB 4       R # r6   )r7   r8   r9   r1   r:   s   &,r   r1   _Outputter.parsing_errorG   s&    4??88B6BCr   c                p    V P                   P                  V P                  P                  ! R/ VB 4       R # r6   )r7   r8   r9   validation_errorr:   s   &,r   rA   _Outputter.validation_errorJ   s&    4??;;EfEFr   c                p    V P                   P                  V P                  P                  ! R/ VB 4       R # r6   )_stdoutr8   r9   validation_successr:   s   &,r   rE   _Outputter.validation_successM   r=   r   r   N)r   r   r   r   r   r9   rD   r7   classmethodr%   r0   r-   r1   rA   rE   r   __classdictcell____classdict__s   @r   r   r   '   sS      JgGgGF F(IDGI Ir   r   c                   L   a  ] tR t^Qt o ]! R4      tRtR tR tR t	R t
RtV tR# )	r"   z`        ===[{type}]===({path})===

        {body}
        -----------------------------
        z===[SUCCESS]===({path})===
c                \    V P                   P                  VR RP                  V4      R7      # )r,   z{!r} does not exist.r)   typebody)
_ERROR_MSGformatr2   r)   r*   s   &&&r   r-   #_PrettyFormatter.filenotfound_error^   s2    %%$'..t4 & 
 	
r   c                    Vw  r4pR P                  \        P                  ! W4V4      4      pV P                  P	                  VVP
                  VR7      # ) rM   )join	tracebackformat_exceptionrP   rQ   r   )r2   r)   r*   exc_type	exc_valueexc_traceback	exc_liness   &&&    r   r1   _PrettyFormatter.parsing_errore   sW    -5*]GG&&xMJ
	 %%"" & 
 	
r   c                f    V P                   P                  VVP                  P                  VR 7      # )rM   )rP   rQ   	__class__r   r2   instance_patherrors   &&&r   rA   !_PrettyFormatter.validation_errorp   s1    %%)) & 
 	
r   c                :    V P                   P                  VR 7      # ))r)   )_SUCCESS_MSGrQ   r2   ra   s   &&r   rE   #_PrettyFormatter.validation_successw   s      '']';;r   r   N)r   r   r   r   r   rP   re   r-   r1   rA   rE   r   rH   rI   s   @r   r"   r"   Q   s6      	J 2L
	

< <r   r"   c                   F   a  ] tR t^{t o ]! 4       tR tR tR tR t	Rt
V tR# )r!   c                $    R P                  V4      # )z{!r} does not exist.
)rQ   rR   s   &&&r   r-   "_PlainFormatter.filenotfound_error   s    '..t44r   c                X    R P                  VR8X  d   RM
\        V4      V^,          4      # )zFailed to parse {}: {}
<stdin>)rQ   reprrR   s   &&&r   r1   _PlainFormatter.parsing_error   s,    )00*IT
QK
 	
r   c                :    V P                   P                  WR 7      # ))	file_namerb   )_error_formatrQ   r`   s   &&&r   rA    _PlainFormatter.validation_error   s    !!((=(NNr   c                    R # )rU   r   rf   s   &&r   rE   "_PlainFormatter.validation_success   s    r   r   N)r   r   r   r   r   rq   r-   r1   rA   rE   r   rH   rI   s   @r   r!   r!   {   s(      GM5
O r   r!   c                 8    R V 9  d
   RV ,           p \        V 4      # ).zjsonschema.r   )names   &r   _resolve_name_with_defaultrx      s    
$t#r   zJSON Schema Validation CLI)descriptionz-iz
--instanceappend	instancesz
        a path to a JSON instance (i.e. filename.json) to validate (may
        be specified multiple times). If no instances are provided via this
        option, one will be expected on standard input.
    )actiondesthelpz-Fz--error-formata  
        the format to use for each validation error message, specified
        in a form suitable for str.format. This string will be passed
        one formatted object named 'error' for each ValidationError.
        Only provide this option when using --output=plain, which is the
        default. If this argument is unprovided and --output=plain is
        used, a simple default representation will be used.
    )r~   z-oz--outputr   r   z
        an output format to use. 'plain' (default) will produce minimal
        text with one line for each error, while 'pretty' will produce
        more detailed human-readable output on multiple lines.
    )choicesdefaultr~   z-Vz--validatorz
        the fully qualified object name of a validator to use, or, for
        validators that are registered with jsonschema, simply the name
        of the class.
    )rN   r~   z
--base-uriz
        a base URI to assign to the provided schema, even if it does not
        declare one (via e.g. $id). This option can be used if you wish to
        resolve relative references to a particular URI (or local path)
    z	--versionversion
jsonschema)r|   r   schemaz=the path to a JSON Schema to validate with (i.e. schema.json)c                     \        \        P                  T ;'       g    R .R7      4      pVR,          R8w  d%   VR,          '       d   \        P                  R4      hVR,          R8X  d   VR,          f   RVR&   V# )z--helpargsr   r   r   z3--error-format can only be used with --output plainz"{error.instance}: {error.message}
)varsparser
parse_argsrb   )r   r$   s   & r   r   r      sx    V&&D,>,>XJ&?@Ig%)N*C*CllA
 	
 g%)N*C*K$I	.!r   c                     R pVP                  V4       F  pRpVP                  WR7       K  	  V'       g   VP                  V R7       V# )FTra   rb   )ra   )iter_errorsrA   rE   )ra   instance	validator	outputterinvalidrb   s   &&&&  r   _validate_instancer      sM    G&&x0"""L 1 $$=$ANr   :   NNc                 Z    \         P                  ! \        \        V R 7      R7      4       R# )r   )r$   N)r.   exitrunr   r   s   &r   mainr      s    HHS:4012r   c           	      v  aa \         P                  V VVR 7      o SP                  V R,          4      pT R,          pTf   \	        T4      p TP                  T4       T R,          '       d   SP                  T R,          rM
TT3R lpR.pT R,          e   \        T R,          TR	7      MRp	T! YIR
7      p
^ pT F"  p T! T4      pT\        TTT
SR7      ,          pK$  	  T#   \         d     ^# i ; i  \         d&   pSP                  T R,          TR7        Rp?^# Rp?ii ; i  \         d    ^p K}  i ; i))r$   r   r    r   r   Nr   r{   c                    <  \         P                  ! S4      #   \         d2    SP                  R \        P
                  ! 4       R7       \        4       hi ; i)rl   r(   )r/   r0   r   r1   r.   r*   r   )_r   stdins   &r   r0   run.<locals>.load
  sO    (yy''" (''"S\\^ (  &''	(s	    <Arl   base_uri)r   referrer)resolver)ra   r   r   r   )
r   r%   r0   r   r   check_schemar	   rA   r
   r   )r$   r   r    r   r   	Validatorrb   r0   r{   r   r   	exit_codeeachr   r   s   &&&f          @r   r   r      sn   )) * I	( 34 +&I!&)	v& #..)K*@i	( K	
 
:		* :& 15 
 &4II
	DzH +"!##	 I  c    ""#H- 	# 	
 <  	I	s;   C" C4 >D'"C10C14D$?DD$'D87D8)+__doc__	importlibr   r/   r   textwrapr   argparser.   rW   warningspkgutilr   ImportErrorpkgutil_resolve_nameattrsr   r   jsonschema.exceptionsr	   jsonschema.validatorsr
   r   warnDeprecationWarning	Exceptionr   r   r"   r!   rx   ArgumentParserr   add_argumentr   r   r   argvr   r   r    r   r   r   r   r   <module>r      s         
  2$   - = 	: 	i 	 &I &I &IR &< &< &<R   ( 
	 	 ,
   ,	
	  	   

  
   *h
	  	   -	#
     
     \*  
   	H   hhrl 3 **SZZsyy :}  2112s   F F F 