mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-06-29 04:00:51 +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}}
|
{{/isExplode}}
|
||||||
{{/isDeepObject}}
|
{{/isDeepObject}}
|
||||||
{{^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}}} {
|
if let Some(ref param_value) = {{{paramName}}} {
|
||||||
local_var_req_builder = local_var_req_builder.query(&[("{{{baseName}}}", ¶m_value.to_string())]);
|
local_var_req_builder = local_var_req_builder.query(&[("{{{baseName}}}", ¶m_value.to_string())]);
|
||||||
};
|
};
|
||||||
|
{{/isObject}}
|
||||||
{{/isDeepObject}}
|
{{/isDeepObject}}
|
||||||
{{/isNullable}}
|
{{/isNullable}}
|
||||||
{{/isArray}}
|
{{/isArray}}
|
||||||
@ -250,7 +259,14 @@ impl {{classname}} for {{classname}}Client {
|
|||||||
{{/isExplode}}
|
{{/isExplode}}
|
||||||
{{/isDeepObject}}
|
{{/isDeepObject}}
|
||||||
{{^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())]);
|
local_var_req_builder = local_var_req_builder.query(&[("{{{baseName}}}", ¶m_value.to_string())]);
|
||||||
|
{{/isObject}}
|
||||||
{{/isDeepObject}}
|
{{/isDeepObject}}
|
||||||
}
|
}
|
||||||
{{/required}}
|
{{/required}}
|
||||||
|
@ -179,10 +179,19 @@ pub {{#supportAsync}}async {{/supportAsync}}fn {{{operationId}}}(configuration:
|
|||||||
};
|
};
|
||||||
{{/isDeepObject}}
|
{{/isDeepObject}}
|
||||||
{{^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}}} {
|
if let Some(ref param_value) = {{{vendorExtensions.x-rust-param-identifier}}} {
|
||||||
req_builder = req_builder.query(&[("{{{baseName}}}", ¶m_value.to_string())]);
|
req_builder = req_builder.query(&[("{{{baseName}}}", ¶m_value.to_string())]);
|
||||||
};
|
};
|
||||||
{{/isDeepObject}}
|
{{/isObject}}
|
||||||
{{/isNullable}}
|
{{/isNullable}}
|
||||||
{{/isArray}}
|
{{/isArray}}
|
||||||
{{/required}}
|
{{/required}}
|
||||||
@ -214,7 +223,14 @@ pub {{#supportAsync}}async {{/supportAsync}}fn {{{operationId}}}(configuration:
|
|||||||
{{/isExplode}}
|
{{/isExplode}}
|
||||||
{{/isDeepObject}}
|
{{/isDeepObject}}
|
||||||
{{^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())]);
|
req_builder = req_builder.query(&[("{{{baseName}}}", ¶m_value.to_string())]);
|
||||||
|
{{/isObject}}
|
||||||
{{/isDeepObject}}
|
{{/isDeepObject}}
|
||||||
{{/isArray}}
|
{{/isArray}}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user