forked from loafle/openapi-generator-original
[rust-client]: fix for collectionFormat=multi (#15626)
* [rust-client]: fix for collection format multi * update rust samples --------- Co-authored-by: Gorka Kobeaga <gorka@kobeaga.eus>
This commit is contained in:
parent
9890f076a9
commit
0e8d997bf6
@ -103,7 +103,7 @@ pub {{#supportAsync}}async {{/supportAsync}}fn {{{operationId}}}(configuration:
|
|||||||
{{#required}}
|
{{#required}}
|
||||||
{{#isArray}}
|
{{#isArray}}
|
||||||
local_var_req_builder = match "{{collectionFormat}}" {
|
local_var_req_builder = match "{{collectionFormat}}" {
|
||||||
"multi" => local_var_req_builder.query(&{{{paramName}}}.into_iter().map(|p| ("{{{baseName}}}".to_owned(), p)).collect::<Vec<(std::string::String, std::string::String)>>()),
|
"multi" => local_var_req_builder.query(&{{{paramName}}}.into_iter().map(|p| ("{{{baseName}}}".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
|
||||||
_ => local_var_req_builder.query(&[("{{{baseName}}}", &{{{paramName}}}.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
|
_ => local_var_req_builder.query(&[("{{{baseName}}}", &{{{paramName}}}.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
|
||||||
};
|
};
|
||||||
{{/isArray}}
|
{{/isArray}}
|
||||||
|
@ -302,7 +302,7 @@ pub async fn find_pets_by_status(configuration: &configuration::Configuration, p
|
|||||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
|
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
|
||||||
|
|
||||||
local_var_req_builder = match "csv" {
|
local_var_req_builder = match "csv" {
|
||||||
"multi" => local_var_req_builder.query(&status.into_iter().map(|p| ("status".to_owned(), p)).collect::<Vec<(std::string::String, std::string::String)>>()),
|
"multi" => local_var_req_builder.query(&status.into_iter().map(|p| ("status".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
|
||||||
_ => local_var_req_builder.query(&[("status", &status.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
|
_ => local_var_req_builder.query(&[("status", &status.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
|
||||||
};
|
};
|
||||||
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
|
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
|
||||||
@ -343,7 +343,7 @@ pub async fn find_pets_by_tags(configuration: &configuration::Configuration, par
|
|||||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
|
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
|
||||||
|
|
||||||
local_var_req_builder = match "csv" {
|
local_var_req_builder = match "csv" {
|
||||||
"multi" => local_var_req_builder.query(&tags.into_iter().map(|p| ("tags".to_owned(), p)).collect::<Vec<(std::string::String, std::string::String)>>()),
|
"multi" => local_var_req_builder.query(&tags.into_iter().map(|p| ("tags".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
|
||||||
_ => local_var_req_builder.query(&[("tags", &tags.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
|
_ => local_var_req_builder.query(&[("tags", &tags.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
|
||||||
};
|
};
|
||||||
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
|
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
|
||||||
|
@ -302,7 +302,7 @@ pub async fn find_pets_by_status(configuration: &configuration::Configuration, p
|
|||||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
|
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
|
||||||
|
|
||||||
local_var_req_builder = match "csv" {
|
local_var_req_builder = match "csv" {
|
||||||
"multi" => local_var_req_builder.query(&status.into_iter().map(|p| ("status".to_owned(), p)).collect::<Vec<(std::string::String, std::string::String)>>()),
|
"multi" => local_var_req_builder.query(&status.into_iter().map(|p| ("status".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
|
||||||
_ => local_var_req_builder.query(&[("status", &status.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
|
_ => local_var_req_builder.query(&[("status", &status.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
|
||||||
};
|
};
|
||||||
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
|
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
|
||||||
@ -343,7 +343,7 @@ pub async fn find_pets_by_tags(configuration: &configuration::Configuration, par
|
|||||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
|
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
|
||||||
|
|
||||||
local_var_req_builder = match "csv" {
|
local_var_req_builder = match "csv" {
|
||||||
"multi" => local_var_req_builder.query(&tags.into_iter().map(|p| ("tags".to_owned(), p)).collect::<Vec<(std::string::String, std::string::String)>>()),
|
"multi" => local_var_req_builder.query(&tags.into_iter().map(|p| ("tags".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
|
||||||
_ => local_var_req_builder.query(&[("tags", &tags.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
|
_ => local_var_req_builder.query(&[("tags", &tags.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
|
||||||
};
|
};
|
||||||
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
|
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
|
||||||
|
@ -184,7 +184,7 @@ pub fn find_pets_by_status(configuration: &configuration::Configuration, status:
|
|||||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
|
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
|
||||||
|
|
||||||
local_var_req_builder = match "csv" {
|
local_var_req_builder = match "csv" {
|
||||||
"multi" => local_var_req_builder.query(&status.into_iter().map(|p| ("status".to_owned(), p)).collect::<Vec<(std::string::String, std::string::String)>>()),
|
"multi" => local_var_req_builder.query(&status.into_iter().map(|p| ("status".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
|
||||||
_ => local_var_req_builder.query(&[("status", &status.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
|
_ => local_var_req_builder.query(&[("status", &status.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
|
||||||
};
|
};
|
||||||
if let Some(ref local_var_aws_v4_key) = local_var_configuration.aws_v4_key {
|
if let Some(ref local_var_aws_v4_key) = local_var_configuration.aws_v4_key {
|
||||||
@ -232,7 +232,7 @@ pub fn find_pets_by_tags(configuration: &configuration::Configuration, tags: Vec
|
|||||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
|
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
|
||||||
|
|
||||||
local_var_req_builder = match "csv" {
|
local_var_req_builder = match "csv" {
|
||||||
"multi" => local_var_req_builder.query(&tags.into_iter().map(|p| ("tags".to_owned(), p)).collect::<Vec<(std::string::String, std::string::String)>>()),
|
"multi" => local_var_req_builder.query(&tags.into_iter().map(|p| ("tags".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
|
||||||
_ => local_var_req_builder.query(&[("tags", &tags.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
|
_ => local_var_req_builder.query(&[("tags", &tags.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
|
||||||
};
|
};
|
||||||
if let Some(ref local_var_aws_v4_key) = local_var_configuration.aws_v4_key {
|
if let Some(ref local_var_aws_v4_key) = local_var_configuration.aws_v4_key {
|
||||||
|
@ -158,7 +158,7 @@ pub fn find_pets_by_status(configuration: &configuration::Configuration, status:
|
|||||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
|
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
|
||||||
|
|
||||||
local_var_req_builder = match "csv" {
|
local_var_req_builder = match "csv" {
|
||||||
"multi" => local_var_req_builder.query(&status.into_iter().map(|p| ("status".to_owned(), p)).collect::<Vec<(std::string::String, std::string::String)>>()),
|
"multi" => local_var_req_builder.query(&status.into_iter().map(|p| ("status".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
|
||||||
_ => local_var_req_builder.query(&[("status", &status.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
|
_ => local_var_req_builder.query(&[("status", &status.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
|
||||||
};
|
};
|
||||||
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
|
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
|
||||||
@ -193,7 +193,7 @@ pub fn find_pets_by_tags(configuration: &configuration::Configuration, tags: Vec
|
|||||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
|
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
|
||||||
|
|
||||||
local_var_req_builder = match "csv" {
|
local_var_req_builder = match "csv" {
|
||||||
"multi" => local_var_req_builder.query(&tags.into_iter().map(|p| ("tags".to_owned(), p)).collect::<Vec<(std::string::String, std::string::String)>>()),
|
"multi" => local_var_req_builder.query(&tags.into_iter().map(|p| ("tags".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
|
||||||
_ => local_var_req_builder.query(&[("tags", &tags.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
|
_ => local_var_req_builder.query(&[("tags", &tags.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
|
||||||
};
|
};
|
||||||
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
|
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user