Skip to content

Commit 44136fb

Browse files
committed
also fix hyper
1 parent e7ddde7 commit 44136fb

8 files changed

Lines changed: 10 additions & 40 deletions

File tree

modules/openapi-generator/src/main/resources/rust/hyper/api.mustache

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,7 @@ impl<C: Connect>{{{classname}}} for {{{classname}}}Client<C>
7878
let query_value = s.iter().map(|s| s.to_string()).collect::<Vec<String>>().join(",");
7979
{{/isArray}}
8080
{{^isArray}}
81-
let query_value = match serde_json::to_string(s) {
82-
Ok(value) => value,
83-
Err(e) => return Box::pin(futures::future::err(Error::Serde(e))),
84-
};
81+
let query_value = s.to_string();
8582
{{/isArray}}
8683
req = req.with_query_param("{{{baseName}}}".to_string(), query_value);
8784
}

modules/openapi-generator/src/main/resources/rust/hyper0x/api.mustache

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,7 @@ impl<C: hyper::client::connect::Connect>{{{classname}}} for {{{classname}}}Clien
7777
let query_value = s.iter().map(|s| s.to_string()).collect::<Vec<String>>().join(",");
7878
{{/isArray}}
7979
{{^isArray}}
80-
let query_value = match serde_json::to_string(s) {
81-
Ok(value) => value,
82-
Err(e) => return Box::pin(futures::future::err(Error::Serde(e))),
83-
};
80+
let query_value = s.to_string();
8481
{{/isArray}}
8582
req = req.with_query_param("{{{baseName}}}".to_string(), query_value);
8683
}

samples/client/petstore/rust/hyper/petstore/src/apis/fake_api.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,7 @@ impl<C: Connect>FakeApi for FakeApiClient<C>
4747
let mut req = __internal_request::Request::new(hyper::Method::GET, "/fake/user/{user_name}".to_string())
4848
;
4949
if let Some(ref s) = content {
50-
let query_value = match serde_json::to_string(s) {
51-
Ok(value) => value,
52-
Err(e) => return Box::pin(futures::future::err(Error::Serde(e))),
53-
};
50+
let query_value = s.to_string();
5451
req = req.with_query_param("content".to_string(), query_value);
5552
}
5653
req = req.with_query_param("anyType".to_string(), any_type.to_string());

samples/client/petstore/rust/hyper/petstore/src/apis/pet_api.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,7 @@ impl<C: Connect>PetApi for PetApiClient<C>
118118
let mut req = __internal_request::Request::new(hyper::Method::POST, "/pets/explode".to_string())
119119
;
120120
if let Some(ref s) = page_explode {
121-
let query_value = match serde_json::to_string(s) {
122-
Ok(value) => value,
123-
Err(e) => return Box::pin(futures::future::err(Error::Serde(e))),
124-
};
121+
let query_value = s.to_string();
125122
req = req.with_query_param("pageExplode".to_string(), query_value);
126123
}
127124

@@ -133,10 +130,7 @@ impl<C: Connect>PetApi for PetApiClient<C>
133130
let mut req = __internal_request::Request::new(hyper::Method::POST, "/pets".to_string())
134131
;
135132
if let Some(ref s) = page {
136-
let query_value = match serde_json::to_string(s) {
137-
Ok(value) => value,
138-
Err(e) => return Box::pin(futures::future::err(Error::Serde(e))),
139-
};
133+
let query_value = s.to_string();
140134
req = req.with_query_param("page".to_string(), query_value);
141135
}
142136

samples/client/petstore/rust/hyper/petstore/src/apis/testing_api.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,7 @@ impl<C: Connect>TestingApi for TestingApiClient<C>
6868
let mut req = __internal_request::Request::new(hyper::Method::GET, "/tests/inlineEnumBoxing".to_string())
6969
;
7070
if let Some(ref s) = status {
71-
let query_value = match serde_json::to_string(s) {
72-
Ok(value) => value,
73-
Err(e) => return Box::pin(futures::future::err(Error::Serde(e))),
74-
};
71+
let query_value = s.to_string();
7572
req = req.with_query_param("status".to_string(), query_value);
7673
}
7774

samples/client/petstore/rust/hyper0x/petstore/src/apis/fake_api.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,7 @@ impl<C: hyper::client::connect::Connect>FakeApi for FakeApiClient<C>
4646
let mut req = __internal_request::Request::new(hyper::Method::GET, "/fake/user/{user_name}".to_string())
4747
;
4848
if let Some(ref s) = content {
49-
let query_value = match serde_json::to_string(s) {
50-
Ok(value) => value,
51-
Err(e) => return Box::pin(futures::future::err(Error::Serde(e))),
52-
};
49+
let query_value = s.to_string();
5350
req = req.with_query_param("content".to_string(), query_value);
5451
}
5552
req = req.with_query_param("anyType".to_string(), any_type.to_string());

samples/client/petstore/rust/hyper0x/petstore/src/apis/pet_api.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,7 @@ impl<C: hyper::client::connect::Connect>PetApi for PetApiClient<C>
117117
let mut req = __internal_request::Request::new(hyper::Method::POST, "/pets/explode".to_string())
118118
;
119119
if let Some(ref s) = page_explode {
120-
let query_value = match serde_json::to_string(s) {
121-
Ok(value) => value,
122-
Err(e) => return Box::pin(futures::future::err(Error::Serde(e))),
123-
};
120+
let query_value = s.to_string();
124121
req = req.with_query_param("pageExplode".to_string(), query_value);
125122
}
126123

@@ -132,10 +129,7 @@ impl<C: hyper::client::connect::Connect>PetApi for PetApiClient<C>
132129
let mut req = __internal_request::Request::new(hyper::Method::POST, "/pets".to_string())
133130
;
134131
if let Some(ref s) = page {
135-
let query_value = match serde_json::to_string(s) {
136-
Ok(value) => value,
137-
Err(e) => return Box::pin(futures::future::err(Error::Serde(e))),
138-
};
132+
let query_value = s.to_string();
139133
req = req.with_query_param("page".to_string(), query_value);
140134
}
141135

samples/client/petstore/rust/hyper0x/petstore/src/apis/testing_api.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,7 @@ impl<C: hyper::client::connect::Connect>TestingApi for TestingApiClient<C>
6767
let mut req = __internal_request::Request::new(hyper::Method::GET, "/tests/inlineEnumBoxing".to_string())
6868
;
6969
if let Some(ref s) = status {
70-
let query_value = match serde_json::to_string(s) {
71-
Ok(value) => value,
72-
Err(e) => return Box::pin(futures::future::err(Error::Serde(e))),
73-
};
70+
let query_value = s.to_string();
7471
req = req.with_query_param("status".to_string(), query_value);
7572
}
7673

0 commit comments

Comments
 (0)