File tree Expand file tree Collapse file tree
modules/openapi-generator/src/main/resources/rust Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -216,9 +216,18 @@ impl {{classname}} for {{classname}}Client {
216216 { {/isExplode} }
217217 { {/isDeepObject} }
218218 { {^isDeepObject} }
219+ { {#isObject} }
220+ { {^isModel} }
221+ if let Some(ref param_value) = { {{paramName} }} {
222+ local_var_req_builder = local_var_req_builder.query(&[(" {{{baseName}}}" , &serde_json::to_value(param_value)?)]);
223+ } ;
224+ { {/isModel} }
225+ { {/isObject} }
226+ { {^isObject} }
219227 if let Some(ref param_value) = { {{paramName} }} {
220228 local_var_req_builder = local_var_req_builder.query(&[(" {{{baseName}}}" , ¶m_value.to_string())]);
221229 } ;
230+ { {/isObject} }
222231 { {/isDeepObject} }
223232 { {/isNullable} }
224233 { {/isArray} }
@@ -250,7 +259,14 @@ impl {{classname}} for {{classname}}Client {
250259 { {/isExplode} }
251260 { {/isDeepObject} }
252261 { {^isDeepObject} }
262+ { {#isObject} }
263+ { {^isModel} }
264+ local_var_req_builder = local_var_req_builder.query(& [("{ {{baseName} }}", &serde_json::to_value(param_value)?)]);
265+ { {/isModel} }
266+ { {/isObject} }
267+ { {^isObject} }
253268 local_var_req_builder = local_var_req_builder.query(& [("{ {{baseName} }}", ¶m_value.to_string())]);
269+ { {/isObject} }
254270 { {/isDeepObject} }
255271 }
256272 { {/required} }
Original file line number Diff line number Diff line change @@ -179,10 +179,19 @@ pub {{#supportAsync}}async {{/supportAsync}}fn {{{operationId}}}(configuration:
179179 };
180180 { {/isDeepObject} }
181181 { {^isDeepObject} }
182+ { {#isObject} }
183+ { {^isModel} }
182184 if let Some(ref param_value) = { {{vendorExtensions.x-rust-param-identifier} }} {
183- req_builder = req_builder.query(&[(" {{{baseName}}}" , ¶m_value. to_string() )]);
185+ req_builder = req_builder.query(&[(" {{{baseName}}}" , &serde_json:: to_string(param_value)? )]);
184186 } ;
187+ { {/isModel} }
188+ { {/isObject} }
185189 { {/isDeepObject} }
190+ { {^isObject} }
191+ if let Some(ref param_value) = { {{vendorExtensions.x-rust-param-identifier} }} {
192+ req_builder = req_builder.query(&[(" {{{baseName}}}" , ¶m_value.to_string())]);
193+ } ;
194+ { {/isObject} }
186195 { {/isNullable} }
187196 { {/isArray} }
188197 { {/required} }
@@ -214,7 +223,14 @@ pub {{#supportAsync}}async {{/supportAsync}}fn {{{operationId}}}(configuration:
214223 { {/isExplode} }
215224 { {/isDeepObject} }
216225 { {^isDeepObject} }
226+ { {#isObject} }
227+ { {^isModel} }
228+ req_builder = req_builder.query(& [("{ {{baseName} }}", &serde_json::to_string(param_value)?)]);
229+ { {/isModel} }
230+ { {/isObject} }
231+ { {^isObject} }
217232 req_builder = req_builder.query(& [("{ {{baseName} }}", ¶m_value.to_string())]);
233+ { {/isObject} }
218234 { {/isDeepObject} }
219235 { {/isArray} }
220236 }
You can’t perform that action at this time.
0 commit comments