@@ -42,11 +42,18 @@ def __init__(
4242 def process (self ) -> python .ClientModel :
4343 stack = Stack ()
4444
45- self .process_servers (self .src .servers , stack .push ('servers' ))
46- self .process_global_responses (self .src .lapidary_responses_global , stack .push ('x-lapidary-responses-global' ))
47- self .process_global_headers (self .src .lapidary_headers_global , stack .push ('x-lapidary-headers-global' ))
48- self .target .client .body .init_method .security = self .process_security (self .src .security , stack .push ('security' ))
49- self .process_paths (self .src .paths , stack .push ('paths' ))
45+ map_process (
46+ self .src ,
47+ stack ,
48+ {
49+ 'servers' : self .process_servers ,
50+ 'lapidary_responses_global' : self .process_global_responses ,
51+ 'lapidary_headers_global' : self .process_global_headers ,
52+ 'security' : self .process_global_security ,
53+ 'paths' : self .process_paths ,
54+ },
55+ )
56+
5057 self .target .schemas .extend (self .schema_converter .schema_modules )
5158 return self .target
5259
@@ -210,15 +217,17 @@ def _mk_params(
210217 params [param .name ] = param
211218 return list (params .values ())
212219
220+ def process_global_security (self , value : Iterable [openapi .SecurityRequirement ] | None , stack : Stack ) -> None :
221+ self .target .client .body .init_method .security = self .process_security (value , stack )
222+
213223 def process_security (
214224 self , value : Iterable [openapi .SecurityRequirement ] | None , stack : Stack
215225 ) -> python .SecurityRequirements | None :
216226 logger .debug ('Process security %s' , stack )
217227 if value is None :
218228 return None
219229
220- security = [self .process_security_requirement (item , stack .push (str (idx ))) for idx , item in enumerate (value )]
221- return security or None
230+ return [self .process_security_requirement (item , stack .push (str (idx ))) for idx , item in enumerate (value )]
222231
223232 def process_security_requirement (
224233 self , value : openapi .SecurityRequirement , stack : Stack
0 commit comments