forked from loafle/openapi-generator-original
chore(deps,rust): requires reqwest 0.11 in blocking generated code (#16927)
* chore(deps,rust): requires reqwest to be 0.11 series even if generate in blocking mode * chore: reflect change * test: reflect blocking Form
This commit is contained in:
parent
fbd02554f5
commit
d671b83a5f
@ -54,7 +54,9 @@ secrecy = "0.8.0"
|
|||||||
{{/withAWSV4Signature}}
|
{{/withAWSV4Signature}}
|
||||||
{{#reqwest}}
|
{{#reqwest}}
|
||||||
{{^supportAsync}}
|
{{^supportAsync}}
|
||||||
reqwest = "~0.9"
|
[dependencies.reqwest]
|
||||||
|
version = "^0.11"
|
||||||
|
features = ["json", "blocking", "multipart"]
|
||||||
{{/supportAsync}}
|
{{/supportAsync}}
|
||||||
{{#supportAsync}}
|
{{#supportAsync}}
|
||||||
{{#supportMiddleware}}
|
{{#supportMiddleware}}
|
||||||
|
@ -244,7 +244,7 @@ pub {{#supportAsync}}async {{/supportAsync}}fn {{{operationId}}}(configuration:
|
|||||||
{{/hasAuthMethods}}
|
{{/hasAuthMethods}}
|
||||||
{{#isMultipart}}
|
{{#isMultipart}}
|
||||||
{{#hasFormParams}}
|
{{#hasFormParams}}
|
||||||
let mut local_var_form = reqwest::multipart::Form::new();
|
let mut local_var_form = reqwest{{^supportAsync}}::blocking{{/supportAsync}}::multipart::Form::new();
|
||||||
{{#formParams}}
|
{{#formParams}}
|
||||||
{{#isFile}}
|
{{#isFile}}
|
||||||
{{^supportAsync}}
|
{{^supportAsync}}
|
||||||
|
@ -11,7 +11,7 @@ use secrecy::{SecretString, ExposeSecret};
|
|||||||
pub struct Configuration {
|
pub struct Configuration {
|
||||||
pub base_path: String,
|
pub base_path: String,
|
||||||
pub user_agent: Option<String>,
|
pub user_agent: Option<String>,
|
||||||
pub client: {{#supportMiddleware}}reqwest_middleware::ClientWithMiddleware{{/supportMiddleware}}{{^supportMiddleware}}reqwest::Client{{/supportMiddleware}},
|
pub client: {{#supportMiddleware}}reqwest_middleware::ClientWithMiddleware{{/supportMiddleware}}{{^supportMiddleware}}reqwest{{^supportAsync}}::blocking{{/supportAsync}}::Client{{/supportMiddleware}},
|
||||||
pub basic_auth: Option<BasicAuth>,
|
pub basic_auth: Option<BasicAuth>,
|
||||||
pub oauth_access_token: Option<String>,
|
pub oauth_access_token: Option<String>,
|
||||||
pub bearer_access_token: Option<String>,
|
pub bearer_access_token: Option<String>,
|
||||||
@ -80,7 +80,7 @@ impl Default for Configuration {
|
|||||||
Configuration {
|
Configuration {
|
||||||
base_path: "{{{basePath}}}".to_owned(),
|
base_path: "{{{basePath}}}".to_owned(),
|
||||||
user_agent: {{#httpUserAgent}}Some("{{{.}}}".to_owned()){{/httpUserAgent}}{{^httpUserAgent}}Some("OpenAPI-Generator/{{{version}}}/rust".to_owned()){{/httpUserAgent}},
|
user_agent: {{#httpUserAgent}}Some("{{{.}}}".to_owned()){{/httpUserAgent}}{{^httpUserAgent}}Some("OpenAPI-Generator/{{{version}}}/rust".to_owned()){{/httpUserAgent}},
|
||||||
client: {{#supportMiddleware}}reqwest_middleware::ClientBuilder::new(reqwest::Client::new()).build(){{/supportMiddleware}}{{^supportMiddleware}}reqwest::Client::new(){{/supportMiddleware}},
|
client: {{#supportMiddleware}}reqwest_middleware::ClientBuilder::new(reqwest{{^supportAsync}}::blocking{{/supportAsync}}::Client::new()).build(){{/supportMiddleware}}{{^supportMiddleware}}reqwest{{^supportAsync}}::blocking{{/supportAsync}}::Client::new(){{/supportMiddleware}},
|
||||||
basic_auth: None,
|
basic_auth: None,
|
||||||
oauth_access_token: None,
|
oauth_access_token: None,
|
||||||
bearer_access_token: None,
|
bearer_access_token: None,
|
||||||
|
@ -13,4 +13,6 @@ serde_with = "^2.0"
|
|||||||
serde_json = "^1.0"
|
serde_json = "^1.0"
|
||||||
url = "^2.2"
|
url = "^2.2"
|
||||||
uuid = { version = "^1.0", features = ["serde", "v4"] }
|
uuid = { version = "^1.0", features = ["serde", "v4"] }
|
||||||
reqwest = "~0.9"
|
[dependencies.reqwest]
|
||||||
|
version = "^0.11"
|
||||||
|
features = ["json", "blocking", "multipart"]
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
pub struct Configuration {
|
pub struct Configuration {
|
||||||
pub base_path: String,
|
pub base_path: String,
|
||||||
pub user_agent: Option<String>,
|
pub user_agent: Option<String>,
|
||||||
pub client: reqwest::Client,
|
pub client: reqwest::blocking::Client,
|
||||||
pub basic_auth: Option<BasicAuth>,
|
pub basic_auth: Option<BasicAuth>,
|
||||||
pub oauth_access_token: Option<String>,
|
pub oauth_access_token: Option<String>,
|
||||||
pub bearer_access_token: Option<String>,
|
pub bearer_access_token: Option<String>,
|
||||||
@ -42,7 +42,7 @@ impl Default for Configuration {
|
|||||||
Configuration {
|
Configuration {
|
||||||
base_path: "http://api.example.xyz/v1".to_owned(),
|
base_path: "http://api.example.xyz/v1".to_owned(),
|
||||||
user_agent: Some("OpenAPI-Generator/0.1.0/rust".to_owned()),
|
user_agent: Some("OpenAPI-Generator/0.1.0/rust".to_owned()),
|
||||||
client: reqwest::Client::new(),
|
client: reqwest::blocking::Client::new(),
|
||||||
basic_auth: None,
|
basic_auth: None,
|
||||||
oauth_access_token: None,
|
oauth_access_token: None,
|
||||||
bearer_access_token: None,
|
bearer_access_token: None,
|
||||||
|
@ -12,4 +12,6 @@ serde_derive = "^1.0"
|
|||||||
serde_json = "^1.0"
|
serde_json = "^1.0"
|
||||||
url = "^2.2"
|
url = "^2.2"
|
||||||
uuid = { version = "^1.0", features = ["serde", "v4"] }
|
uuid = { version = "^1.0", features = ["serde", "v4"] }
|
||||||
reqwest = "~0.9"
|
[dependencies.reqwest]
|
||||||
|
version = "^0.11"
|
||||||
|
features = ["json", "blocking", "multipart"]
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
pub struct Configuration {
|
pub struct Configuration {
|
||||||
pub base_path: String,
|
pub base_path: String,
|
||||||
pub user_agent: Option<String>,
|
pub user_agent: Option<String>,
|
||||||
pub client: reqwest::Client,
|
pub client: reqwest::blocking::Client,
|
||||||
pub basic_auth: Option<BasicAuth>,
|
pub basic_auth: Option<BasicAuth>,
|
||||||
pub oauth_access_token: Option<String>,
|
pub oauth_access_token: Option<String>,
|
||||||
pub bearer_access_token: Option<String>,
|
pub bearer_access_token: Option<String>,
|
||||||
@ -42,7 +42,7 @@ impl Default for Configuration {
|
|||||||
Configuration {
|
Configuration {
|
||||||
base_path: "http://petstore.swagger.io/v2".to_owned(),
|
base_path: "http://petstore.swagger.io/v2".to_owned(),
|
||||||
user_agent: Some("OpenAPI-Generator/1.0.0/rust".to_owned()),
|
user_agent: Some("OpenAPI-Generator/1.0.0/rust".to_owned()),
|
||||||
client: reqwest::Client::new(),
|
client: reqwest::blocking::Client::new(),
|
||||||
basic_auth: None,
|
basic_auth: None,
|
||||||
oauth_access_token: None,
|
oauth_access_token: None,
|
||||||
bearer_access_token: None,
|
bearer_access_token: None,
|
||||||
|
@ -16,4 +16,6 @@ uuid = { version = "^1.0", features = ["serde", "v4"] }
|
|||||||
aws-sigv4 = "0.3.0"
|
aws-sigv4 = "0.3.0"
|
||||||
http = "0.2.5"
|
http = "0.2.5"
|
||||||
secrecy = "0.8.0"
|
secrecy = "0.8.0"
|
||||||
reqwest = "~0.9"
|
[dependencies.reqwest]
|
||||||
|
version = "^0.11"
|
||||||
|
features = ["json", "blocking", "multipart"]
|
||||||
|
@ -18,7 +18,7 @@ use secrecy::{SecretString, ExposeSecret};
|
|||||||
pub struct Configuration {
|
pub struct Configuration {
|
||||||
pub base_path: String,
|
pub base_path: String,
|
||||||
pub user_agent: Option<String>,
|
pub user_agent: Option<String>,
|
||||||
pub client: reqwest::Client,
|
pub client: reqwest::blocking::Client,
|
||||||
pub basic_auth: Option<BasicAuth>,
|
pub basic_auth: Option<BasicAuth>,
|
||||||
pub oauth_access_token: Option<String>,
|
pub oauth_access_token: Option<String>,
|
||||||
pub bearer_access_token: Option<String>,
|
pub bearer_access_token: Option<String>,
|
||||||
@ -83,7 +83,7 @@ impl Default for Configuration {
|
|||||||
Configuration {
|
Configuration {
|
||||||
base_path: "http://petstore.swagger.io/v2".to_owned(),
|
base_path: "http://petstore.swagger.io/v2".to_owned(),
|
||||||
user_agent: Some("OpenAPI-Generator/1.0.0/rust".to_owned()),
|
user_agent: Some("OpenAPI-Generator/1.0.0/rust".to_owned()),
|
||||||
client: reqwest::Client::new(),
|
client: reqwest::blocking::Client::new(),
|
||||||
basic_auth: None,
|
basic_auth: None,
|
||||||
oauth_access_token: None,
|
oauth_access_token: None,
|
||||||
bearer_access_token: None,
|
bearer_access_token: None,
|
||||||
|
@ -444,7 +444,7 @@ pub fn upload_file(configuration: &configuration::Configuration, pet_id: i64, ad
|
|||||||
if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
|
if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
|
||||||
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
|
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
|
||||||
};
|
};
|
||||||
let mut local_var_form = reqwest::multipart::Form::new();
|
let mut local_var_form = reqwest::blocking::multipart::Form::new();
|
||||||
if let Some(local_var_param_value) = additional_metadata {
|
if let Some(local_var_param_value) = additional_metadata {
|
||||||
local_var_form = local_var_form.text("additionalMetadata", local_var_param_value.to_string());
|
local_var_form = local_var_form.text("additionalMetadata", local_var_param_value.to_string());
|
||||||
}
|
}
|
||||||
|
@ -13,4 +13,6 @@ serde_with = "^2.0"
|
|||||||
serde_json = "^1.0"
|
serde_json = "^1.0"
|
||||||
url = "^2.2"
|
url = "^2.2"
|
||||||
uuid = { version = "^1.0", features = ["serde", "v4"] }
|
uuid = { version = "^1.0", features = ["serde", "v4"] }
|
||||||
reqwest = "~0.9"
|
[dependencies.reqwest]
|
||||||
|
version = "^0.11"
|
||||||
|
features = ["json", "blocking", "multipart"]
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
pub struct Configuration {
|
pub struct Configuration {
|
||||||
pub base_path: String,
|
pub base_path: String,
|
||||||
pub user_agent: Option<String>,
|
pub user_agent: Option<String>,
|
||||||
pub client: reqwest::Client,
|
pub client: reqwest::blocking::Client,
|
||||||
pub basic_auth: Option<BasicAuth>,
|
pub basic_auth: Option<BasicAuth>,
|
||||||
pub oauth_access_token: Option<String>,
|
pub oauth_access_token: Option<String>,
|
||||||
pub bearer_access_token: Option<String>,
|
pub bearer_access_token: Option<String>,
|
||||||
@ -42,7 +42,7 @@ impl Default for Configuration {
|
|||||||
Configuration {
|
Configuration {
|
||||||
base_path: "http://petstore.swagger.io/v2".to_owned(),
|
base_path: "http://petstore.swagger.io/v2".to_owned(),
|
||||||
user_agent: Some("OpenAPI-Generator/1.0.0/rust".to_owned()),
|
user_agent: Some("OpenAPI-Generator/1.0.0/rust".to_owned()),
|
||||||
client: reqwest::Client::new(),
|
client: reqwest::blocking::Client::new(),
|
||||||
basic_auth: None,
|
basic_auth: None,
|
||||||
oauth_access_token: None,
|
oauth_access_token: None,
|
||||||
bearer_access_token: None,
|
bearer_access_token: None,
|
||||||
|
@ -340,7 +340,7 @@ pub fn upload_file(configuration: &configuration::Configuration, pet_id: i64, ad
|
|||||||
if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
|
if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
|
||||||
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
|
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
|
||||||
};
|
};
|
||||||
let mut local_var_form = reqwest::multipart::Form::new();
|
let mut local_var_form = reqwest::blocking::multipart::Form::new();
|
||||||
if let Some(local_var_param_value) = additional_metadata {
|
if let Some(local_var_param_value) = additional_metadata {
|
||||||
local_var_form = local_var_form.text("additionalMetadata", local_var_param_value.to_string());
|
local_var_form = local_var_form.text("additionalMetadata", local_var_param_value.to_string());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user