
    |V
h                     <    S SK r S SKrS SKrS\S\4S jrS\4S jrg)    Napp_detailsreturnc                   #    U R                  SS5      n[        R                  " U5      n[        U[        5      (       a  SU;   a  US   nUR                  S5      (       a  [        U5      I Sh  vN nU$ UR                  S5      (       a  g[        R                  " 5       n[        R                  R                  USUR                  S5      5      n [        USS	S
9 n[        R                  " U5      nSSS5        U$ U$ g N! , (       d  f       U$ = f! [         a    [        SU 35         g[        R                    a    [        SU 35         gf = f7f)aD  
Load the API schema as JSON. If 'api_schema' in app_details is a dictionary containing a 'url' key,
check if the URL starts with 'https'. If not, treat it as a relative path to the local_directory.
If it starts with 'https', load JSON from the URL directly. Otherwise, return 'api_schema' directly 
if it is a JSON object.

api_schemaNurlzhttps://zhttp://zapp/api/v1/apps/sdk/json/rzutf-8)encodingzFile not found: zError decoding JSON from file: )getjsonloads
isinstancedict
startswithload_json_from_urlosgetcwdpathjoinlstripopenloadFileNotFoundErrorprintJSONDecodeError)r   api_schema_strr   r   current_directory
local_pathfiles          IC:\Suresh\moveshuttle\MDcreated\moveengine\app\v1\libraries\jsonloader.pyload_api_schema_as_jsonr!      s?     !__\48NN+J*d##JU#C~~j))$6s$;;
& # 	** %'IIK!WW\\*;=WY\YcYcdgYhi
 j#@D%)YYt_
 A z+ < A@  )  ,ZL9:++  ;J<HI sg   A-E/D0A"ED D5D =E
DD ED E.E0!EEEEr   c                   #    [         R                  " 5        IS h  vN nUR                  U 5       IS h  vN nUR                  S:X  a:  UR	                  5       I S h  vN sS S S 5      IS h  vN   sS S S 5      IS h  vN   $ [        SU  SUR                   35      e N Nk NE N7 N(! , IS h  vN  (       d  f       O= fS S S 5      IS h  vN    g ! , IS h  vN  (       d  f       g = f7f)N   zFailed to load JSON from URL: z - Status Code: )aiohttpClientSessionr   statusr   	Exception)r   sessionresponses      r    r   r   ,   s     $$&&';;s##x#%%]]_, $## '&&
  "@EUV^VeVeUf ghh '#, $ '### '&&&&&s   C0B C0CB"C$B*B$B*"C.B&/C3C0?B( C0B* C0"C$B*&C(C0*C	0B31C	=CC0CC0C-CC-)C0)r   r   r$   r   r!   strr        r    <module>r-      s0    	  $t $ $Ni# ir,   