File tree Expand file tree Collapse file tree
modules/openapi-generator/src/main/resources/rust
samples/client/petstore/rust
hyper0x/petstore/src/apis Expand file tree Collapse file tree Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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 ( ) ) ;
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 ( ) ) ;
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments