@@ -125,7 +125,7 @@ impl Lowerer<'_> {
125125 for name in path_param_names ( path) {
126126 let declared = find_path_param ( & name, operation, shared_params) ;
127127 let ty = match declared {
128- Some ( format) => self . param_type ( path, & name, format) ?,
128+ Some ( format) => self . param_type ( path, method , & name, format) ?,
129129 None => RustType :: String ,
130130 } ;
131131 params. push ( Param {
@@ -166,19 +166,19 @@ fn path_param_schema<'a>(name: &str, parameters: &'a [ReferenceOr<Parameter>]) -
166166
167167/// Map a path parameter's schema to a scalar Rust type.
168168impl Lowerer < ' _ > {
169- fn param_type ( & self , path : & str , name : & str , format : & ParameterSchemaOrContent ) -> Result < RustType > {
169+ fn param_type ( & self , path : & str , method : & str , name : & str , format : & ParameterSchemaOrContent ) -> Result < RustType > {
170170 let schema = match format {
171171 ParameterSchemaOrContent :: Schema ( schema) => schema,
172172 ParameterSchemaOrContent :: Content ( _) => {
173173 return Err ( Error :: UnsupportedOperation {
174- method : "*" . to_owned ( ) ,
174+ method : method . to_owned ( ) ,
175175 path : path. to_owned ( ) ,
176176 reason : format ! ( "path parameter `{name}` uses `content`, which is not supported" ) ,
177177 } ) ;
178178 }
179179 } ;
180180 let schema = match schema {
181- ReferenceOr :: Reference { reference } => return self . named_from_ref ( path, reference) ,
181+ ReferenceOr :: Reference { reference } => return self . named_from_ref ( path, method , reference) ,
182182 ReferenceOr :: Item ( schema) => schema,
183183 } ;
184184 let ty = match & schema. schema_kind {
@@ -188,7 +188,7 @@ impl Lowerer<'_> {
188188 SchemaKind :: Type ( Type :: Boolean ( _) ) => RustType :: Bool ,
189189 _ => {
190190 return Err ( Error :: UnsupportedOperation {
191- method : "*" . to_owned ( ) ,
191+ method : method . to_owned ( ) ,
192192 path : path. to_owned ( ) ,
193193 reason : format ! ( "path parameter `{name}` must be a scalar type" ) ,
194194 } ) ;
@@ -291,7 +291,7 @@ impl Lowerer<'_> {
291291 /// their emission.
292292 fn body_type ( & self , path : & str , method : & str , schema : & ReferenceOr < Schema > ) -> Result < RustType > {
293293 match schema {
294- ReferenceOr :: Reference { reference } => return self . named_from_ref ( path, reference) ,
294+ ReferenceOr :: Reference { reference } => return self . named_from_ref ( path, method , reference) ,
295295 ReferenceOr :: Item ( schema) => return self . inline_body_type ( path, method, schema) ,
296296 }
297297 }
@@ -305,7 +305,7 @@ impl Lowerer<'_> {
305305 SchemaKind :: Type ( Type :: Boolean ( _) ) => RustType :: Bool ,
306306 SchemaKind :: Type ( Type :: Array ( at) ) => {
307307 let element = match & at. items {
308- Some ( ReferenceOr :: Reference { reference } ) => self . named_from_ref ( path, reference) ?,
308+ Some ( ReferenceOr :: Reference { reference } ) => self . named_from_ref ( path, method , reference) ?,
309309 Some ( ReferenceOr :: Item ( item) ) => self . inline_body_type ( path, method, item) ?,
310310 None => RustType :: Value ,
311311 } ;
@@ -326,10 +326,10 @@ impl Lowerer<'_> {
326326 /// Resolve a `$ref` string to a named type. Same-document references become
327327 /// a local [`RustType::Named`]; cross-file references are routed through the
328328 /// `import-mapping` to a [`RustType::External`].
329- fn named_from_ref ( & self , path : & str , reference : & str ) -> Result < RustType > {
329+ fn named_from_ref ( & self , path : & str , method : & str , reference : & str ) -> Result < RustType > {
330330 let target = ref_target_name ( reference) . ok_or_else ( || {
331331 return Error :: UnsupportedOperation {
332- method : "*" . to_owned ( ) ,
332+ method : method . to_owned ( ) ,
333333 path : path. to_owned ( ) ,
334334 reason : format ! ( "reference `{reference}` must point at a component schema" ) ,
335335 } ;
@@ -339,7 +339,7 @@ impl Lowerer<'_> {
339339 } ;
340340 let module = self . import_mapping . get ( file) . ok_or_else ( || {
341341 return Error :: UnsupportedOperation {
342- method : "*" . to_owned ( ) ,
342+ method : method . to_owned ( ) ,
343343 path : path. to_owned ( ) ,
344344 reason : format ! ( "cross-file reference `{reference}` needs an `import-mapping` entry for `{file}`" ) ,
345345 } ;
0 commit comments