mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-05-12 12:40:53 +00:00
[rust] detect normal non deep objects
This commit is contained in:
parent
0509909a20
commit
94d1b02bb1
@ -216,9 +216,18 @@ impl {{classname}} for {{classname}}Client {
|
||||
{{/isExplode}}
|
||||
{{/isDeepObject}}
|
||||
{{^isDeepObject}}
|
||||
{{#isObject}}
|
||||
{{^isModel}}
|
||||
if let Some(ref param_value) = {{{paramName}}} {
|
||||
local_var_req_builder = local_var_req_builder.query(&[("{{{baseName}}}", &serde_json::to_value(param_value)?)]);
|
||||
};
|
||||
{{/isModel}}
|
||||
{{/isObject}}
|
||||
{{^isObject}}
|
||||
if let Some(ref param_value) = {{{paramName}}} {
|
||||
local_var_req_builder = local_var_req_builder.query(&[("{{{baseName}}}", ¶m_value.to_string())]);
|
||||
};
|
||||
{{/isObject}}
|
||||
{{/isDeepObject}}
|
||||
{{/isNullable}}
|
||||
{{/isArray}}
|
||||
@ -250,7 +259,14 @@ impl {{classname}} for {{classname}}Client {
|
||||
{{/isExplode}}
|
||||
{{/isDeepObject}}
|
||||
{{^isDeepObject}}
|
||||
{{#isObject}}
|
||||
{{^isModel}}
|
||||
local_var_req_builder = local_var_req_builder.query(&[("{{{baseName}}}", &serde_json::to_value(param_value)?)]);
|
||||
{{/isModel}}
|
||||
{{/isObject}}
|
||||
{{^isObject}}
|
||||
local_var_req_builder = local_var_req_builder.query(&[("{{{baseName}}}", ¶m_value.to_string())]);
|
||||
{{/isObject}}
|
||||
{{/isDeepObject}}
|
||||
}
|
||||
{{/required}}
|
||||
|
@ -179,10 +179,19 @@ pub {{#supportAsync}}async {{/supportAsync}}fn {{{operationId}}}(configuration:
|
||||
};
|
||||
{{/isDeepObject}}
|
||||
{{^isDeepObject}}
|
||||
{{#isObject}}
|
||||
{{^isModel}}
|
||||
if let Some(ref param_value) = {{{vendorExtensions.x-rust-param-identifier}}} {
|
||||
req_builder = req_builder.query(&[("{{{baseName}}}", &serde_json::to_string(param_value)?)]);
|
||||
};
|
||||
{{/isModel}}
|
||||
{{/isObject}}
|
||||
{{/isDeepObject}}
|
||||
{{^isObject}}
|
||||
if let Some(ref param_value) = {{{vendorExtensions.x-rust-param-identifier}}} {
|
||||
req_builder = req_builder.query(&[("{{{baseName}}}", ¶m_value.to_string())]);
|
||||
};
|
||||
{{/isDeepObject}}
|
||||
{{/isObject}}
|
||||
{{/isNullable}}
|
||||
{{/isArray}}
|
||||
{{/required}}
|
||||
@ -214,7 +223,14 @@ pub {{#supportAsync}}async {{/supportAsync}}fn {{{operationId}}}(configuration:
|
||||
{{/isExplode}}
|
||||
{{/isDeepObject}}
|
||||
{{^isDeepObject}}
|
||||
{{#isObject}}
|
||||
{{^isModel}}
|
||||
req_builder = req_builder.query(&[("{{{baseName}}}", &serde_json::to_string(param_value)?)]);
|
||||
{{/isModel}}
|
||||
{{/isObject}}
|
||||
{{^isObject}}
|
||||
req_builder = req_builder.query(&[("{{{baseName}}}", ¶m_value.to_string())]);
|
||||
{{/isObject}}
|
||||
{{/isDeepObject}}
|
||||
{{/isArray}}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user