diff --git a/modules/swagger-codegen/src/main/resources/rust/api.mustache b/modules/swagger-codegen/src/main/resources/rust/api.mustache index 14da83f68e1..21c45ef38db 100644 --- a/modules/swagger-codegen/src/main/resources/rust/api.mustache +++ b/modules/swagger-codegen/src/main/resources/rust/api.mustache @@ -75,7 +75,7 @@ impl{{classname}} for {{classname}}Client { {{#hasBodyParam}} {{#bodyParams}} - let serialized = serde_json::to_string(&body).unwrap(); + let serialized = serde_json::to_string(&{{paramName}}).unwrap(); req.headers_mut().set(hyper::header::ContentType::json()); req.headers_mut().set(hyper::header::ContentLength(serialized.len() as u64)); req.set_body(serialized);