diff --git a/modules/openapi-generator/src/main/resources/rust/reqwest-trait/api.mustache b/modules/openapi-generator/src/main/resources/rust/reqwest-trait/api.mustache index ff3d54ddcc2d..c11fed0ac474 100644 --- a/modules/openapi-generator/src/main/resources/rust/reqwest-trait/api.mustache +++ b/modules/openapi-generator/src/main/resources/rust/reqwest-trait/api.mustache @@ -206,11 +206,8 @@ impl {{classname}} for {{classname}}Client { {{/isModel}} {{#isMap}} if let Some(ref param_value) = {{{paramName}}} { - let mut query_params = Vec::with_capacity(param_value.len()); - for (key, value) in param_value.iter() { - query_params.push((key.to_string(), serde_json::to_string(value)?)); - } - local_var_req_builder = local_var_req_builder.query(&query_params); + let params = crate::apis::parse_deep_object("{{{baseName}}}", &serde_json::to_value(param_value)?); + local_var_req_builder = local_var_req_builder.query(¶ms); } {{/isMap}} {{/isExplode}} @@ -256,11 +253,8 @@ impl {{classname}} for {{classname}}Client { local_var_req_builder = local_var_req_builder.query(¶m_value); {{/isModel}} {{#isMap}} - let mut query_params = Vec::with_capacity(param_value.len()); - for (key, value) in param_value.iter() { - query_params.push((key.to_string(), serde_json::to_string(value)?)); - } - local_var_req_builder = local_var_req_builder.query(&query_params); + let params = crate::apis::parse_deep_object("{{{baseName}}}", &serde_json::to_value(param_value)?); + local_var_req_builder = local_var_req_builder.query(¶ms); {{/isMap}} {{/isExplode}} {{/isDeepObject}} diff --git a/modules/openapi-generator/src/main/resources/rust/reqwest/api.mustache b/modules/openapi-generator/src/main/resources/rust/reqwest/api.mustache index 5224b0c4d9b5..14e99143c12b 100644 --- a/modules/openapi-generator/src/main/resources/rust/reqwest/api.mustache +++ b/modules/openapi-generator/src/main/resources/rust/reqwest/api.mustache @@ -180,11 +180,8 @@ pub {{#supportAsync}}async {{/supportAsync}}fn {{{operationId}}}(configuration: req_builder = req_builder.query(¶m_value); {{/isModel}} {{#isMap}} - let mut query_params = Vec::with_capacity(param_value.len()); - for (key, value) in param_value.iter() { - query_params.push((key.to_string(), serde_json::to_string(value)?)); - } - req_builder = req_builder.query(&query_params); + let params = crate::apis::parse_deep_object("{{{baseName}}}", &serde_json::to_value(param_value)?); + req_builder = req_builder.query(¶ms); {{/isMap}} {{/isExplode}} }; @@ -251,11 +248,8 @@ pub {{#supportAsync}}async {{/supportAsync}}fn {{{operationId}}}(configuration: req_builder = req_builder.query(¶m_value); {{/isModel}} {{#isMap}} - let mut query_params = Vec::with_capacity(param_value.len()); - for (key, value) in param_value.iter() { - query_params.push((key.to_string(), serde_json::to_string(value)?)); - } - req_builder = req_builder.query(&query_params); + let params = crate::apis::parse_deep_object("{{{baseName}}}", &serde_json::to_value(param_value)?); + req_builder = req_builder.query(¶ms); {{/isMap}} {{/isExplode}} {{/isDeepObject}} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/rust/RustClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/rust/RustClientCodegenTest.java index f4a92edebb6c..78b680c1380e 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/rust/RustClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/rust/RustClientCodegenTest.java @@ -319,6 +319,31 @@ public void testIntegerPropertyEnum() throws IOException { TestUtils.assertFileNotContains(outputPath, linearize("#[serde(rename = \"0\")]")); } + @Test + public void testExplodedDeepObjectMapQueryParams() throws IOException { + // exploded deepObject maps (typed or free-form) go through parse_deep_object like the non-explode branch + for (String library : new String[] {"reqwest", "reqwest-trait"}) { + Path target = Files.createTempDirectory("test"); + target.toFile().deleteOnExit(); + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("rust") + .setLibrary(library) + .setInputSpec("src/test/resources/3_0/rust/deep-object-free-form-query-param.yaml") + .setSkipOverwrite(false) + .setOutputDir(target.toAbsolutePath().toString().replace("\\", "/")); + List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); + files.forEach(File::deleteOnExit); + Path outputPath = Path.of(target.toString(), "/src/apis/default_api.rs"); + TestUtils.assertFileExists(outputPath); + // optional typed map, optional free-form object, required-nullable typed map + TestUtils.assertFileContains(outputPath, "crate::apis::parse_deep_object(\"filter\""); + TestUtils.assertFileContains(outputPath, "crate::apis::parse_deep_object(\"extra\""); + TestUtils.assertFileContains(outputPath, "crate::apis::parse_deep_object(\"scope\""); + TestUtils.assertFileNotContains(outputPath, "param_value.len()"); + TestUtils.assertFileNotContains(outputPath, "param_value.iter()"); + } + } + @Test public void testArrayWithObjectEnumValues() throws IOException { Path target = Files.createTempDirectory("test"); diff --git a/modules/openapi-generator/src/test/resources/3_0/rust/deep-object-free-form-query-param.yaml b/modules/openapi-generator/src/test/resources/3_0/rust/deep-object-free-form-query-param.yaml new file mode 100644 index 000000000000..0a2c992091a4 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/rust/deep-object-free-form-query-param.yaml @@ -0,0 +1,36 @@ +openapi: 3.0.3 +info: + title: deep object params + version: 1.0.0 +paths: + /items: + get: + operationId: listItems + parameters: + - name: filter + in: query + style: deepObject + explode: true + schema: + type: object + additionalProperties: + type: string + - name: extra + in: query + style: deepObject + explode: true + schema: + type: object + - name: scope + in: query + required: true + style: deepObject + explode: true + schema: + type: object + nullable: true + additionalProperties: + type: string + responses: + '200': + description: ok diff --git a/modules/openapi-generator/src/test/resources/3_0/rust/petstore.yaml b/modules/openapi-generator/src/test/resources/3_0/rust/petstore.yaml index 984954994b4a..d7543bdbddb4 100644 --- a/modules/openapi-generator/src/test/resources/3_0/rust/petstore.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/rust/petstore.yaml @@ -763,6 +763,39 @@ paths: type: array items: $ref: '#/components/schemas/ModelWithInlineEnum' + + '/tests/deep-object-free-form-query-param': + get: + tags: + - testing + parameters: + - name: filter + in: query + style: deepObject + explode: true + schema: + type: object + additionalProperties: + type: string + - name: extra + in: query + style: deepObject + explode: true + schema: + type: object + - name: scope + in: query + required: true + style: deepObject + explode: true + schema: + type: object + nullable: true + additionalProperties: + type: string + responses: + '200': + description: ok externalDocs: description: Find out more about Swagger url: 'http://swagger.io' diff --git a/samples/client/petstore/rust/hyper/petstore/README.md b/samples/client/petstore/rust/hyper/petstore/README.md index f04632c5832d..ee880dd8c74f 100644 --- a/samples/client/petstore/rust/hyper/petstore/README.md +++ b/samples/client/petstore/rust/hyper/petstore/README.md @@ -42,6 +42,7 @@ Class | Method | HTTP request | Description *StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **Get** /store/order/{orderId} | Find purchase order by ID *StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **Post** /store/order | Place an order for a pet *TestingApi* | [**tests_all_of_with_one_model_get**](docs/TestingApi.md#tests_all_of_with_one_model_get) | **Get** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) +*TestingApi* | [**tests_deep_object_free_form_query_param_get**](docs/TestingApi.md#tests_deep_object_free_form_query_param_get) | **Get** /tests/deep-object-free-form-query-param | *TestingApi* | [**tests_file_response_get**](docs/TestingApi.md#tests_file_response_get) | **Get** /tests/fileResponse | Returns an image file *TestingApi* | [**tests_inline_enum_boxing_get**](docs/TestingApi.md#tests_inline_enum_boxing_get) | **Get** /tests/inlineEnumBoxing | Get model with inline enums *TestingApi* | [**tests_inline_enum_boxing_post**](docs/TestingApi.md#tests_inline_enum_boxing_post) | **Post** /tests/inlineEnumBoxing | Test for inline enum fields not being boxed in model constructors diff --git a/samples/client/petstore/rust/hyper/petstore/docs/TestingApi.md b/samples/client/petstore/rust/hyper/petstore/docs/TestingApi.md index 4409e5141e7d..b40a9cbf54b8 100644 --- a/samples/client/petstore/rust/hyper/petstore/docs/TestingApi.md +++ b/samples/client/petstore/rust/hyper/petstore/docs/TestingApi.md @@ -5,6 +5,7 @@ All URIs are relative to *http://localhost/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**tests_all_of_with_one_model_get**](TestingApi.md#tests_all_of_with_one_model_get) | **Get** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) +[**tests_deep_object_free_form_query_param_get**](TestingApi.md#tests_deep_object_free_form_query_param_get) | **Get** /tests/deep-object-free-form-query-param | [**tests_file_response_get**](TestingApi.md#tests_file_response_get) | **Get** /tests/fileResponse | Returns an image file [**tests_inline_enum_boxing_get**](TestingApi.md#tests_inline_enum_boxing_get) | **Get** /tests/inlineEnumBoxing | Get model with inline enums [**tests_inline_enum_boxing_post**](TestingApi.md#tests_inline_enum_boxing_post) | **Post** /tests/inlineEnumBoxing | Test for inline enum fields not being boxed in model constructors @@ -40,6 +41,36 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## tests_deep_object_free_form_query_param_get + +> tests_deep_object_free_form_query_param_get(scope, filter, extra) + + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**scope** | Option<[**std::collections::HashMap**](String.md)> | | [required] | +**filter** | Option<[**std::collections::HashMap**](String.md)> | | | +**extra** | Option<[**serde_json::Value**](SerdeJson__Value.md)> | | | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + ## tests_file_response_get > std::path::PathBuf tests_file_response_get() diff --git a/samples/client/petstore/rust/hyper/petstore/src/apis/testing_api.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/testing_api.rs index 18e5de4ddfec..ad3f19a91d6c 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/apis/testing_api.rs @@ -38,6 +38,7 @@ impl TestingApiClient pub trait TestingApi: Send + Sync { fn tests_all_of_with_one_model_get(&self, person: models::Person) -> Pin> + Send>>; + fn tests_deep_object_free_form_query_param_get(&self, scope: Option>, filter: Option>, extra: Option) -> Pin> + Send>>; fn tests_file_response_get(&self, ) -> Pin> + Send>>; fn tests_inline_enum_boxing_get(&self, status: Option<&str>) -> Pin, Error>> + Send>>; fn tests_inline_enum_boxing_post(&self, model_with_inline_enum: models::ModelWithInlineEnum) -> Pin> + Send>>; @@ -55,6 +56,33 @@ implTestingApi for TestingApiClient req.execute(self.configuration.borrow()) } + #[allow(unused_mut)] + fn tests_deep_object_free_form_query_param_get(&self, scope: Option>, filter: Option>, extra: Option) -> Pin> + Send>> { + let mut req = __internal_request::Request::new(hyper::Method::GET, "/tests/deep-object-free-form-query-param".to_string()) + ; + if let Some(ref s) = filter { + let query_value = match serde_json::to_string(s) { + Ok(value) => value, + Err(e) => return Box::pin(futures::future::err(Error::Serde(e))), + }; + req = req.with_query_param("filter".to_string(), query_value); + } + if let Some(ref s) = extra { + let query_value = match serde_json::to_string(s) { + Ok(value) => value, + Err(e) => return Box::pin(futures::future::err(Error::Serde(e))), + }; + req = req.with_query_param("extra".to_string(), query_value); + } + match scope { + Some(param_value) => { req = req.with_query_param("scope".to_string(), param_value.to_string()); }, + None => { req = req.with_query_param("scope".to_string(), "".to_string()); }, + } + req = req.returns_nothing(); + + req.execute(self.configuration.borrow()) + } + #[allow(unused_mut)] fn tests_file_response_get(&self, ) -> Pin> + Send>> { let mut req = __internal_request::Request::new(hyper::Method::GET, "/tests/fileResponse".to_string()) diff --git a/samples/client/petstore/rust/hyper0x/petstore/README.md b/samples/client/petstore/rust/hyper0x/petstore/README.md index d6411d487783..f44ef336fcf5 100644 --- a/samples/client/petstore/rust/hyper0x/petstore/README.md +++ b/samples/client/petstore/rust/hyper0x/petstore/README.md @@ -42,6 +42,7 @@ Class | Method | HTTP request | Description *StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID *StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet *TestingApi* | [**tests_all_of_with_one_model_get**](docs/TestingApi.md#tests_all_of_with_one_model_get) | **GET** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) +*TestingApi* | [**tests_deep_object_free_form_query_param_get**](docs/TestingApi.md#tests_deep_object_free_form_query_param_get) | **GET** /tests/deep-object-free-form-query-param | *TestingApi* | [**tests_file_response_get**](docs/TestingApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file *TestingApi* | [**tests_inline_enum_boxing_get**](docs/TestingApi.md#tests_inline_enum_boxing_get) | **GET** /tests/inlineEnumBoxing | Get model with inline enums *TestingApi* | [**tests_inline_enum_boxing_post**](docs/TestingApi.md#tests_inline_enum_boxing_post) | **POST** /tests/inlineEnumBoxing | Test for inline enum fields not being boxed in model constructors diff --git a/samples/client/petstore/rust/hyper0x/petstore/docs/TestingApi.md b/samples/client/petstore/rust/hyper0x/petstore/docs/TestingApi.md index a14a8e0c081d..5c2b5941231b 100644 --- a/samples/client/petstore/rust/hyper0x/petstore/docs/TestingApi.md +++ b/samples/client/petstore/rust/hyper0x/petstore/docs/TestingApi.md @@ -5,6 +5,7 @@ All URIs are relative to *http://localhost/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**tests_all_of_with_one_model_get**](TestingApi.md#tests_all_of_with_one_model_get) | **GET** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) +[**tests_deep_object_free_form_query_param_get**](TestingApi.md#tests_deep_object_free_form_query_param_get) | **GET** /tests/deep-object-free-form-query-param | [**tests_file_response_get**](TestingApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file [**tests_inline_enum_boxing_get**](TestingApi.md#tests_inline_enum_boxing_get) | **GET** /tests/inlineEnumBoxing | Get model with inline enums [**tests_inline_enum_boxing_post**](TestingApi.md#tests_inline_enum_boxing_post) | **POST** /tests/inlineEnumBoxing | Test for inline enum fields not being boxed in model constructors @@ -40,6 +41,36 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## tests_deep_object_free_form_query_param_get + +> tests_deep_object_free_form_query_param_get(scope, filter, extra) + + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**scope** | Option<[**std::collections::HashMap**](String.md)> | | [required] | +**filter** | Option<[**std::collections::HashMap**](String.md)> | | | +**extra** | Option<[**serde_json::Value**](SerdeJson__Value.md)> | | | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + ## tests_file_response_get > std::path::PathBuf tests_file_response_get() diff --git a/samples/client/petstore/rust/hyper0x/petstore/src/apis/testing_api.rs b/samples/client/petstore/rust/hyper0x/petstore/src/apis/testing_api.rs index ff544bb10870..3d5edc48c8e0 100644 --- a/samples/client/petstore/rust/hyper0x/petstore/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/hyper0x/petstore/src/apis/testing_api.rs @@ -37,6 +37,7 @@ impl TestingApiClient pub trait TestingApi { fn tests_all_of_with_one_model_get(&self, person: models::Person) -> Pin>>>; + fn tests_deep_object_free_form_query_param_get(&self, scope: Option>, filter: Option>, extra: Option) -> Pin>>>; fn tests_file_response_get(&self, ) -> Pin>>>; fn tests_inline_enum_boxing_get(&self, status: Option<&str>) -> Pin, Error>>>>; fn tests_inline_enum_boxing_post(&self, model_with_inline_enum: models::ModelWithInlineEnum) -> Pin>>>; @@ -54,6 +55,33 @@ implTestingApi for TestingApiClient req.execute(self.configuration.borrow()) } + #[allow(unused_mut)] + fn tests_deep_object_free_form_query_param_get(&self, scope: Option>, filter: Option>, extra: Option) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::GET, "/tests/deep-object-free-form-query-param".to_string()) + ; + if let Some(ref s) = filter { + let query_value = match serde_json::to_string(s) { + Ok(value) => value, + Err(e) => return Box::pin(futures::future::err(Error::Serde(e))), + }; + req = req.with_query_param("filter".to_string(), query_value); + } + if let Some(ref s) = extra { + let query_value = match serde_json::to_string(s) { + Ok(value) => value, + Err(e) => return Box::pin(futures::future::err(Error::Serde(e))), + }; + req = req.with_query_param("extra".to_string(), query_value); + } + match scope { + Some(param_value) => { req = req.with_query_param("scope".to_string(), param_value.to_string()); }, + None => { req = req.with_query_param("scope".to_string(), "".to_string()); }, + } + req = req.returns_nothing(); + + req.execute(self.configuration.borrow()) + } + #[allow(unused_mut)] fn tests_file_response_get(&self, ) -> Pin>>> { let mut req = __internal_request::Request::new(hyper::Method::GET, "/tests/fileResponse".to_string()) diff --git a/samples/client/petstore/rust/reqwest-trait/petstore/README.md b/samples/client/petstore/rust/reqwest-trait/petstore/README.md index 56a28b3e8229..dd1fb1d90b02 100644 --- a/samples/client/petstore/rust/reqwest-trait/petstore/README.md +++ b/samples/client/petstore/rust/reqwest-trait/petstore/README.md @@ -42,6 +42,7 @@ Class | Method | HTTP request | Description *StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID *StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet *TestingApi* | [**tests_all_of_with_one_model_get**](docs/TestingApi.md#tests_all_of_with_one_model_get) | **GET** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) +*TestingApi* | [**tests_deep_object_free_form_query_param_get**](docs/TestingApi.md#tests_deep_object_free_form_query_param_get) | **GET** /tests/deep-object-free-form-query-param | *TestingApi* | [**tests_file_response_get**](docs/TestingApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file *TestingApi* | [**tests_inline_enum_boxing_get**](docs/TestingApi.md#tests_inline_enum_boxing_get) | **GET** /tests/inlineEnumBoxing | Get model with inline enums *TestingApi* | [**tests_inline_enum_boxing_post**](docs/TestingApi.md#tests_inline_enum_boxing_post) | **POST** /tests/inlineEnumBoxing | Test for inline enum fields not being boxed in model constructors diff --git a/samples/client/petstore/rust/reqwest-trait/petstore/docs/TestingApi.md b/samples/client/petstore/rust/reqwest-trait/petstore/docs/TestingApi.md index a14a8e0c081d..5c2b5941231b 100644 --- a/samples/client/petstore/rust/reqwest-trait/petstore/docs/TestingApi.md +++ b/samples/client/petstore/rust/reqwest-trait/petstore/docs/TestingApi.md @@ -5,6 +5,7 @@ All URIs are relative to *http://localhost/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**tests_all_of_with_one_model_get**](TestingApi.md#tests_all_of_with_one_model_get) | **GET** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) +[**tests_deep_object_free_form_query_param_get**](TestingApi.md#tests_deep_object_free_form_query_param_get) | **GET** /tests/deep-object-free-form-query-param | [**tests_file_response_get**](TestingApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file [**tests_inline_enum_boxing_get**](TestingApi.md#tests_inline_enum_boxing_get) | **GET** /tests/inlineEnumBoxing | Get model with inline enums [**tests_inline_enum_boxing_post**](TestingApi.md#tests_inline_enum_boxing_post) | **POST** /tests/inlineEnumBoxing | Test for inline enum fields not being boxed in model constructors @@ -40,6 +41,36 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## tests_deep_object_free_form_query_param_get + +> tests_deep_object_free_form_query_param_get(scope, filter, extra) + + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**scope** | Option<[**std::collections::HashMap**](String.md)> | | [required] | +**filter** | Option<[**std::collections::HashMap**](String.md)> | | | +**extra** | Option<[**serde_json::Value**](SerdeJson__Value.md)> | | | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + ## tests_file_response_get > std::path::PathBuf tests_file_response_get() diff --git a/samples/client/petstore/rust/reqwest-trait/petstore/src/apis/testing_api.rs b/samples/client/petstore/rust/reqwest-trait/petstore/src/apis/testing_api.rs index 7dc23023226d..78af315d8421 100644 --- a/samples/client/petstore/rust/reqwest-trait/petstore/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/reqwest-trait/petstore/src/apis/testing_api.rs @@ -28,6 +28,11 @@ pub trait TestingApi: Send + Sync { /// async fn tests_all_of_with_one_model_get<'person>(&self, person: models::Person) -> Result>; + /// GET /tests/deep-object-free-form-query-param + /// + /// + async fn tests_deep_object_free_form_query_param_get<'scope, 'filter, 'extra>(&self, scope: Option>, filter: Option>, extra: Option) -> Result<(), Error>; + /// GET /tests/fileResponse /// /// @@ -101,6 +106,45 @@ impl TestingApi for TestingApiClient { } } + async fn tests_deep_object_free_form_query_param_get<'scope, 'filter, 'extra>(&self, scope: Option>, filter: Option>, extra: Option) -> Result<(), Error> { + let local_var_configuration = &self.configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/tests/deep-object-free-form-query-param", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref param_value) = filter { + let params = crate::apis::parse_deep_object("filter", &serde_json::to_value(param_value)?); + local_var_req_builder = local_var_req_builder.query(¶ms); + } + if let Some(ref param_value) = extra { + let params = crate::apis::parse_deep_object("extra", &serde_json::to_value(param_value)?); + local_var_req_builder = local_var_req_builder.query(¶ms); + } + if let Some(ref param_value) = scope { + let params = crate::apis::parse_deep_object("scope", &serde_json::to_value(param_value)?); + local_var_req_builder = local_var_req_builder.query(¶ms); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } + } + async fn tests_file_response_get<>(&self, ) -> Result> { let local_var_configuration = &self.configuration; @@ -264,6 +308,13 @@ pub enum TestsAllOfWithOneModelGetError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`TestingApi::tests_deep_object_free_form_query_param_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TestsDeepObjectFreeFormQueryParamGetError { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`TestingApi::tests_file_response_get`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/README.md b/samples/client/petstore/rust/reqwest/petstore-async-middleware/README.md index 7ade583f5529..6f3f651843ab 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/README.md +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/README.md @@ -42,6 +42,7 @@ Class | Method | HTTP request | Description *StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID *StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet *TestingApi* | [**tests_all_of_with_one_model_get**](docs/TestingApi.md#tests_all_of_with_one_model_get) | **GET** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) +*TestingApi* | [**tests_deep_object_free_form_query_param_get**](docs/TestingApi.md#tests_deep_object_free_form_query_param_get) | **GET** /tests/deep-object-free-form-query-param | *TestingApi* | [**tests_file_response_get**](docs/TestingApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file *TestingApi* | [**tests_inline_enum_boxing_get**](docs/TestingApi.md#tests_inline_enum_boxing_get) | **GET** /tests/inlineEnumBoxing | Get model with inline enums *TestingApi* | [**tests_inline_enum_boxing_post**](docs/TestingApi.md#tests_inline_enum_boxing_post) | **POST** /tests/inlineEnumBoxing | Test for inline enum fields not being boxed in model constructors diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/TestingApi.md b/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/TestingApi.md index a14a8e0c081d..5c2b5941231b 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/TestingApi.md +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/TestingApi.md @@ -5,6 +5,7 @@ All URIs are relative to *http://localhost/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**tests_all_of_with_one_model_get**](TestingApi.md#tests_all_of_with_one_model_get) | **GET** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) +[**tests_deep_object_free_form_query_param_get**](TestingApi.md#tests_deep_object_free_form_query_param_get) | **GET** /tests/deep-object-free-form-query-param | [**tests_file_response_get**](TestingApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file [**tests_inline_enum_boxing_get**](TestingApi.md#tests_inline_enum_boxing_get) | **GET** /tests/inlineEnumBoxing | Get model with inline enums [**tests_inline_enum_boxing_post**](TestingApi.md#tests_inline_enum_boxing_post) | **POST** /tests/inlineEnumBoxing | Test for inline enum fields not being boxed in model constructors @@ -40,6 +41,36 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## tests_deep_object_free_form_query_param_get + +> tests_deep_object_free_form_query_param_get(scope, filter, extra) + + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**scope** | Option<[**std::collections::HashMap**](String.md)> | | [required] | +**filter** | Option<[**std::collections::HashMap**](String.md)> | | | +**extra** | Option<[**serde_json::Value**](SerdeJson__Value.md)> | | | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + ## tests_file_response_get > std::path::PathBuf tests_file_response_get() diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/testing_api.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/testing_api.rs index 20d2c519d4b6..926fb3bebe51 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/testing_api.rs @@ -20,6 +20,14 @@ pub struct TestsAllOfWithOneModelGetParams { pub person: models::Person } +/// struct for passing parameters to the method [`tests_deep_object_free_form_query_param_get`] +#[derive(Clone, Debug)] +pub struct TestsDeepObjectFreeFormQueryParamGetParams { + pub scope: Option>, + pub filter: Option>, + pub extra: Option +} + /// struct for passing parameters to the method [`tests_inline_enum_boxing_get`] #[derive(Clone, Debug)] pub struct TestsInlineEnumBoxingGetParams { @@ -42,6 +50,14 @@ pub enum TestsAllOfWithOneModelGetSuccess { UnknownValue(serde_json::Value), } +/// struct for typed successes of method [`tests_deep_object_free_form_query_param_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TestsDeepObjectFreeFormQueryParamGetSuccess { + Status200(), + UnknownValue(serde_json::Value), +} + /// struct for typed successes of method [`tests_file_response_get`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -81,6 +97,13 @@ pub enum TestsAllOfWithOneModelGetError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`tests_deep_object_free_form_query_param_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TestsDeepObjectFreeFormQueryParamGetError { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`tests_file_response_get`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -136,6 +159,46 @@ pub async fn tests_all_of_with_one_model_get(configuration: &configuration::Conf } } +pub async fn tests_deep_object_free_form_query_param_get(configuration: &configuration::Configuration, params: TestsDeepObjectFreeFormQueryParamGetParams) -> Result, Error> { + + let uri_str = format!("{}/tests/deep-object-free-form-query-param", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = params.filter { + let params = crate::apis::parse_deep_object("filter", &serde_json::to_value(param_value)?); + req_builder = req_builder.query(¶ms); + } + if let Some(ref param_value) = params.extra { + let params = crate::apis::parse_deep_object("extra", &serde_json::to_value(param_value)?); + req_builder = req_builder.query(¶ms); + } + if let Some(ref param_value) = params.scope { + let params = crate::apis::parse_deep_object("scope", &serde_json::to_value(param_value)?); + req_builder = req_builder.query(¶ms); + }; + if let Some(ref param_value) = params.scope { + req_builder = req_builder.query(&[("scope", &serde_json::to_string(param_value)?)]); + }; + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Ok(ResponseContent { status, content, entity }) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + pub async fn tests_file_response_get(configuration: &configuration::Configuration) -> Result> { let uri_str = format!("{}/tests/fileResponse", configuration.base_path); diff --git a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/README.md b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/README.md index 3c78d0d2f65f..077406ff75bd 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/README.md +++ b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/README.md @@ -42,6 +42,7 @@ Class | Method | HTTP request | Description *StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID *StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet *TestingApi* | [**tests_all_of_with_one_model_get**](docs/TestingApi.md#tests_all_of_with_one_model_get) | **GET** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) +*TestingApi* | [**tests_deep_object_free_form_query_param_get**](docs/TestingApi.md#tests_deep_object_free_form_query_param_get) | **GET** /tests/deep-object-free-form-query-param | *TestingApi* | [**tests_file_response_get**](docs/TestingApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file *TestingApi* | [**tests_inline_enum_boxing_get**](docs/TestingApi.md#tests_inline_enum_boxing_get) | **GET** /tests/inlineEnumBoxing | Get model with inline enums *TestingApi* | [**tests_inline_enum_boxing_post**](docs/TestingApi.md#tests_inline_enum_boxing_post) | **POST** /tests/inlineEnumBoxing | Test for inline enum fields not being boxed in model constructors diff --git a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/TestingApi.md b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/TestingApi.md index a14a8e0c081d..5c2b5941231b 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/TestingApi.md +++ b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/TestingApi.md @@ -5,6 +5,7 @@ All URIs are relative to *http://localhost/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**tests_all_of_with_one_model_get**](TestingApi.md#tests_all_of_with_one_model_get) | **GET** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) +[**tests_deep_object_free_form_query_param_get**](TestingApi.md#tests_deep_object_free_form_query_param_get) | **GET** /tests/deep-object-free-form-query-param | [**tests_file_response_get**](TestingApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file [**tests_inline_enum_boxing_get**](TestingApi.md#tests_inline_enum_boxing_get) | **GET** /tests/inlineEnumBoxing | Get model with inline enums [**tests_inline_enum_boxing_post**](TestingApi.md#tests_inline_enum_boxing_post) | **POST** /tests/inlineEnumBoxing | Test for inline enum fields not being boxed in model constructors @@ -40,6 +41,36 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## tests_deep_object_free_form_query_param_get + +> tests_deep_object_free_form_query_param_get(scope, filter, extra) + + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**scope** | Option<[**std::collections::HashMap**](String.md)> | | [required] | +**filter** | Option<[**std::collections::HashMap**](String.md)> | | | +**extra** | Option<[**serde_json::Value**](SerdeJson__Value.md)> | | | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + ## tests_file_response_get > std::path::PathBuf tests_file_response_get() diff --git a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/apis/testing_api.rs b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/apis/testing_api.rs index 20d2c519d4b6..926fb3bebe51 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/apis/testing_api.rs @@ -20,6 +20,14 @@ pub struct TestsAllOfWithOneModelGetParams { pub person: models::Person } +/// struct for passing parameters to the method [`tests_deep_object_free_form_query_param_get`] +#[derive(Clone, Debug)] +pub struct TestsDeepObjectFreeFormQueryParamGetParams { + pub scope: Option>, + pub filter: Option>, + pub extra: Option +} + /// struct for passing parameters to the method [`tests_inline_enum_boxing_get`] #[derive(Clone, Debug)] pub struct TestsInlineEnumBoxingGetParams { @@ -42,6 +50,14 @@ pub enum TestsAllOfWithOneModelGetSuccess { UnknownValue(serde_json::Value), } +/// struct for typed successes of method [`tests_deep_object_free_form_query_param_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TestsDeepObjectFreeFormQueryParamGetSuccess { + Status200(), + UnknownValue(serde_json::Value), +} + /// struct for typed successes of method [`tests_file_response_get`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -81,6 +97,13 @@ pub enum TestsAllOfWithOneModelGetError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`tests_deep_object_free_form_query_param_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TestsDeepObjectFreeFormQueryParamGetError { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`tests_file_response_get`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -136,6 +159,46 @@ pub async fn tests_all_of_with_one_model_get(configuration: &configuration::Conf } } +pub async fn tests_deep_object_free_form_query_param_get(configuration: &configuration::Configuration, params: TestsDeepObjectFreeFormQueryParamGetParams) -> Result, Error> { + + let uri_str = format!("{}/tests/deep-object-free-form-query-param", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = params.filter { + let params = crate::apis::parse_deep_object("filter", &serde_json::to_value(param_value)?); + req_builder = req_builder.query(¶ms); + } + if let Some(ref param_value) = params.extra { + let params = crate::apis::parse_deep_object("extra", &serde_json::to_value(param_value)?); + req_builder = req_builder.query(¶ms); + } + if let Some(ref param_value) = params.scope { + let params = crate::apis::parse_deep_object("scope", &serde_json::to_value(param_value)?); + req_builder = req_builder.query(¶ms); + }; + if let Some(ref param_value) = params.scope { + req_builder = req_builder.query(&[("scope", &serde_json::to_string(param_value)?)]); + }; + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Ok(ResponseContent { status, content, entity }) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + pub async fn tests_file_response_get(configuration: &configuration::Configuration) -> Result> { let uri_str = format!("{}/tests/fileResponse", configuration.base_path); diff --git a/samples/client/petstore/rust/reqwest/petstore-async/README.md b/samples/client/petstore/rust/reqwest/petstore-async/README.md index b25caf0ceeda..4b2c1bc01f8b 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/README.md +++ b/samples/client/petstore/rust/reqwest/petstore-async/README.md @@ -42,6 +42,7 @@ Class | Method | HTTP request | Description *StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID *StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet *TestingApi* | [**tests_all_of_with_one_model_get**](docs/TestingApi.md#tests_all_of_with_one_model_get) | **GET** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) +*TestingApi* | [**tests_deep_object_free_form_query_param_get**](docs/TestingApi.md#tests_deep_object_free_form_query_param_get) | **GET** /tests/deep-object-free-form-query-param | *TestingApi* | [**tests_file_response_get**](docs/TestingApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file *TestingApi* | [**tests_inline_enum_boxing_get**](docs/TestingApi.md#tests_inline_enum_boxing_get) | **GET** /tests/inlineEnumBoxing | Get model with inline enums *TestingApi* | [**tests_inline_enum_boxing_post**](docs/TestingApi.md#tests_inline_enum_boxing_post) | **POST** /tests/inlineEnumBoxing | Test for inline enum fields not being boxed in model constructors diff --git a/samples/client/petstore/rust/reqwest/petstore-async/docs/TestingApi.md b/samples/client/petstore/rust/reqwest/petstore-async/docs/TestingApi.md index a14a8e0c081d..5c2b5941231b 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/docs/TestingApi.md +++ b/samples/client/petstore/rust/reqwest/petstore-async/docs/TestingApi.md @@ -5,6 +5,7 @@ All URIs are relative to *http://localhost/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**tests_all_of_with_one_model_get**](TestingApi.md#tests_all_of_with_one_model_get) | **GET** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) +[**tests_deep_object_free_form_query_param_get**](TestingApi.md#tests_deep_object_free_form_query_param_get) | **GET** /tests/deep-object-free-form-query-param | [**tests_file_response_get**](TestingApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file [**tests_inline_enum_boxing_get**](TestingApi.md#tests_inline_enum_boxing_get) | **GET** /tests/inlineEnumBoxing | Get model with inline enums [**tests_inline_enum_boxing_post**](TestingApi.md#tests_inline_enum_boxing_post) | **POST** /tests/inlineEnumBoxing | Test for inline enum fields not being boxed in model constructors @@ -40,6 +41,36 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## tests_deep_object_free_form_query_param_get + +> tests_deep_object_free_form_query_param_get(scope, filter, extra) + + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**scope** | Option<[**std::collections::HashMap**](String.md)> | | [required] | +**filter** | Option<[**std::collections::HashMap**](String.md)> | | | +**extra** | Option<[**serde_json::Value**](SerdeJson__Value.md)> | | | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + ## tests_file_response_get > std::path::PathBuf tests_file_response_get() diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/testing_api.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/testing_api.rs index 20d2c519d4b6..926fb3bebe51 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/testing_api.rs @@ -20,6 +20,14 @@ pub struct TestsAllOfWithOneModelGetParams { pub person: models::Person } +/// struct for passing parameters to the method [`tests_deep_object_free_form_query_param_get`] +#[derive(Clone, Debug)] +pub struct TestsDeepObjectFreeFormQueryParamGetParams { + pub scope: Option>, + pub filter: Option>, + pub extra: Option +} + /// struct for passing parameters to the method [`tests_inline_enum_boxing_get`] #[derive(Clone, Debug)] pub struct TestsInlineEnumBoxingGetParams { @@ -42,6 +50,14 @@ pub enum TestsAllOfWithOneModelGetSuccess { UnknownValue(serde_json::Value), } +/// struct for typed successes of method [`tests_deep_object_free_form_query_param_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TestsDeepObjectFreeFormQueryParamGetSuccess { + Status200(), + UnknownValue(serde_json::Value), +} + /// struct for typed successes of method [`tests_file_response_get`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -81,6 +97,13 @@ pub enum TestsAllOfWithOneModelGetError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`tests_deep_object_free_form_query_param_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TestsDeepObjectFreeFormQueryParamGetError { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`tests_file_response_get`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -136,6 +159,46 @@ pub async fn tests_all_of_with_one_model_get(configuration: &configuration::Conf } } +pub async fn tests_deep_object_free_form_query_param_get(configuration: &configuration::Configuration, params: TestsDeepObjectFreeFormQueryParamGetParams) -> Result, Error> { + + let uri_str = format!("{}/tests/deep-object-free-form-query-param", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = params.filter { + let params = crate::apis::parse_deep_object("filter", &serde_json::to_value(param_value)?); + req_builder = req_builder.query(¶ms); + } + if let Some(ref param_value) = params.extra { + let params = crate::apis::parse_deep_object("extra", &serde_json::to_value(param_value)?); + req_builder = req_builder.query(¶ms); + } + if let Some(ref param_value) = params.scope { + let params = crate::apis::parse_deep_object("scope", &serde_json::to_value(param_value)?); + req_builder = req_builder.query(¶ms); + }; + if let Some(ref param_value) = params.scope { + req_builder = req_builder.query(&[("scope", &serde_json::to_string(param_value)?)]); + }; + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Ok(ResponseContent { status, content, entity }) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + pub async fn tests_file_response_get(configuration: &configuration::Configuration) -> Result> { let uri_str = format!("{}/tests/fileResponse", configuration.base_path); diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/README.md b/samples/client/petstore/rust/reqwest/petstore-avoid-box/README.md index 76d02f3d514a..1d8cf52b8dca 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/README.md +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/README.md @@ -42,6 +42,7 @@ Class | Method | HTTP request | Description *StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID *StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet *TestingApi* | [**tests_all_of_with_one_model_get**](docs/TestingApi.md#tests_all_of_with_one_model_get) | **GET** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) +*TestingApi* | [**tests_deep_object_free_form_query_param_get**](docs/TestingApi.md#tests_deep_object_free_form_query_param_get) | **GET** /tests/deep-object-free-form-query-param | *TestingApi* | [**tests_file_response_get**](docs/TestingApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file *TestingApi* | [**tests_inline_enum_boxing_get**](docs/TestingApi.md#tests_inline_enum_boxing_get) | **GET** /tests/inlineEnumBoxing | Get model with inline enums *TestingApi* | [**tests_inline_enum_boxing_post**](docs/TestingApi.md#tests_inline_enum_boxing_post) | **POST** /tests/inlineEnumBoxing | Test for inline enum fields not being boxed in model constructors diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/TestingApi.md b/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/TestingApi.md index a14a8e0c081d..5c2b5941231b 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/TestingApi.md +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/TestingApi.md @@ -5,6 +5,7 @@ All URIs are relative to *http://localhost/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**tests_all_of_with_one_model_get**](TestingApi.md#tests_all_of_with_one_model_get) | **GET** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) +[**tests_deep_object_free_form_query_param_get**](TestingApi.md#tests_deep_object_free_form_query_param_get) | **GET** /tests/deep-object-free-form-query-param | [**tests_file_response_get**](TestingApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file [**tests_inline_enum_boxing_get**](TestingApi.md#tests_inline_enum_boxing_get) | **GET** /tests/inlineEnumBoxing | Get model with inline enums [**tests_inline_enum_boxing_post**](TestingApi.md#tests_inline_enum_boxing_post) | **POST** /tests/inlineEnumBoxing | Test for inline enum fields not being boxed in model constructors @@ -40,6 +41,36 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## tests_deep_object_free_form_query_param_get + +> tests_deep_object_free_form_query_param_get(scope, filter, extra) + + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**scope** | Option<[**std::collections::HashMap**](String.md)> | | [required] | +**filter** | Option<[**std::collections::HashMap**](String.md)> | | | +**extra** | Option<[**serde_json::Value**](SerdeJson__Value.md)> | | | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + ## tests_file_response_get > std::path::PathBuf tests_file_response_get() diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/testing_api.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/testing_api.rs index 20d2c519d4b6..926fb3bebe51 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/testing_api.rs @@ -20,6 +20,14 @@ pub struct TestsAllOfWithOneModelGetParams { pub person: models::Person } +/// struct for passing parameters to the method [`tests_deep_object_free_form_query_param_get`] +#[derive(Clone, Debug)] +pub struct TestsDeepObjectFreeFormQueryParamGetParams { + pub scope: Option>, + pub filter: Option>, + pub extra: Option +} + /// struct for passing parameters to the method [`tests_inline_enum_boxing_get`] #[derive(Clone, Debug)] pub struct TestsInlineEnumBoxingGetParams { @@ -42,6 +50,14 @@ pub enum TestsAllOfWithOneModelGetSuccess { UnknownValue(serde_json::Value), } +/// struct for typed successes of method [`tests_deep_object_free_form_query_param_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TestsDeepObjectFreeFormQueryParamGetSuccess { + Status200(), + UnknownValue(serde_json::Value), +} + /// struct for typed successes of method [`tests_file_response_get`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -81,6 +97,13 @@ pub enum TestsAllOfWithOneModelGetError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`tests_deep_object_free_form_query_param_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TestsDeepObjectFreeFormQueryParamGetError { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`tests_file_response_get`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -136,6 +159,46 @@ pub async fn tests_all_of_with_one_model_get(configuration: &configuration::Conf } } +pub async fn tests_deep_object_free_form_query_param_get(configuration: &configuration::Configuration, params: TestsDeepObjectFreeFormQueryParamGetParams) -> Result, Error> { + + let uri_str = format!("{}/tests/deep-object-free-form-query-param", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = params.filter { + let params = crate::apis::parse_deep_object("filter", &serde_json::to_value(param_value)?); + req_builder = req_builder.query(¶ms); + } + if let Some(ref param_value) = params.extra { + let params = crate::apis::parse_deep_object("extra", &serde_json::to_value(param_value)?); + req_builder = req_builder.query(¶ms); + } + if let Some(ref param_value) = params.scope { + let params = crate::apis::parse_deep_object("scope", &serde_json::to_value(param_value)?); + req_builder = req_builder.query(¶ms); + }; + if let Some(ref param_value) = params.scope { + req_builder = req_builder.query(&[("scope", &serde_json::to_string(param_value)?)]); + }; + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Ok(ResponseContent { status, content, entity }) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + pub async fn tests_file_response_get(configuration: &configuration::Configuration) -> Result> { let uri_str = format!("{}/tests/fileResponse", configuration.base_path); diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/README.md b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/README.md index 6310392f0fac..75773e4c0100 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/README.md +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/README.md @@ -42,6 +42,7 @@ Class | Method | HTTP request | Description *StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID *StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet *TestingApi* | [**tests_all_of_with_one_model_get**](docs/TestingApi.md#tests_all_of_with_one_model_get) | **GET** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) +*TestingApi* | [**tests_deep_object_free_form_query_param_get**](docs/TestingApi.md#tests_deep_object_free_form_query_param_get) | **GET** /tests/deep-object-free-form-query-param | *TestingApi* | [**tests_file_response_get**](docs/TestingApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file *TestingApi* | [**tests_inline_enum_boxing_get**](docs/TestingApi.md#tests_inline_enum_boxing_get) | **GET** /tests/inlineEnumBoxing | Get model with inline enums *TestingApi* | [**tests_inline_enum_boxing_post**](docs/TestingApi.md#tests_inline_enum_boxing_post) | **POST** /tests/inlineEnumBoxing | Test for inline enum fields not being boxed in model constructors diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/TestingApi.md b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/TestingApi.md index a14a8e0c081d..5c2b5941231b 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/TestingApi.md +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/TestingApi.md @@ -5,6 +5,7 @@ All URIs are relative to *http://localhost/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**tests_all_of_with_one_model_get**](TestingApi.md#tests_all_of_with_one_model_get) | **GET** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) +[**tests_deep_object_free_form_query_param_get**](TestingApi.md#tests_deep_object_free_form_query_param_get) | **GET** /tests/deep-object-free-form-query-param | [**tests_file_response_get**](TestingApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file [**tests_inline_enum_boxing_get**](TestingApi.md#tests_inline_enum_boxing_get) | **GET** /tests/inlineEnumBoxing | Get model with inline enums [**tests_inline_enum_boxing_post**](TestingApi.md#tests_inline_enum_boxing_post) | **POST** /tests/inlineEnumBoxing | Test for inline enum fields not being boxed in model constructors @@ -40,6 +41,36 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## tests_deep_object_free_form_query_param_get + +> tests_deep_object_free_form_query_param_get(scope, filter, extra) + + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**scope** | Option<[**std::collections::HashMap**](String.md)> | | [required] | +**filter** | Option<[**std::collections::HashMap**](String.md)> | | | +**extra** | Option<[**serde_json::Value**](SerdeJson__Value.md)> | | | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + ## tests_file_response_get > std::path::PathBuf tests_file_response_get() diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/testing_api.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/testing_api.rs index f286b427dac9..213d3ed5612f 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/testing_api.rs @@ -22,6 +22,13 @@ pub enum TestsAllOfWithOneModelGetError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`tests_deep_object_free_form_query_param_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TestsDeepObjectFreeFormQueryParamGetError { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`tests_file_response_get`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -88,6 +95,48 @@ pub fn tests_all_of_with_one_model_get(configuration: &configuration::Configurat } } +pub fn tests_deep_object_free_form_query_param_get(configuration: &configuration::Configuration, scope: Option>, filter: Option>, extra: Option) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_scope = scope; + let p_query_filter = filter; + let p_query_extra = extra; + + let uri_str = format!("{}/tests/deep-object-free-form-query-param", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_filter { + let params = crate::apis::parse_deep_object("filter", &serde_json::to_value(param_value)?); + req_builder = req_builder.query(¶ms); + } + if let Some(ref param_value) = p_query_extra { + let params = crate::apis::parse_deep_object("extra", &serde_json::to_value(param_value)?); + req_builder = req_builder.query(¶ms); + } + if let Some(ref param_value) = p_query_scope { + let params = crate::apis::parse_deep_object("scope", &serde_json::to_value(param_value)?); + req_builder = req_builder.query(¶ms); + }; + if let Some(ref param_value) = p_query_scope { + req_builder = req_builder.query(&[("scope", &serde_json::to_string(param_value)?)]); + }; + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req)?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text()?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + pub fn tests_file_response_get(configuration: &configuration::Configuration, ) -> Result> { let uri_str = format!("{}/tests/fileResponse", configuration.base_path); diff --git a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/README.md b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/README.md index 44d16d2693a3..e3ddf9c464f9 100644 --- a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/README.md +++ b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/README.md @@ -42,6 +42,7 @@ Class | Method | HTTP request | Description *StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID *StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet *TestingApi* | [**tests_all_of_with_one_model_get**](docs/TestingApi.md#tests_all_of_with_one_model_get) | **GET** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) +*TestingApi* | [**tests_deep_object_free_form_query_param_get**](docs/TestingApi.md#tests_deep_object_free_form_query_param_get) | **GET** /tests/deep-object-free-form-query-param | *TestingApi* | [**tests_file_response_get**](docs/TestingApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file *TestingApi* | [**tests_inline_enum_boxing_get**](docs/TestingApi.md#tests_inline_enum_boxing_get) | **GET** /tests/inlineEnumBoxing | Get model with inline enums *TestingApi* | [**tests_inline_enum_boxing_post**](docs/TestingApi.md#tests_inline_enum_boxing_post) | **POST** /tests/inlineEnumBoxing | Test for inline enum fields not being boxed in model constructors diff --git a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/TestingApi.md b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/TestingApi.md index 55e67cfc4aff..d2a3b9ec12ee 100644 --- a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/TestingApi.md +++ b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/TestingApi.md @@ -5,6 +5,7 @@ All URIs are relative to *http://localhost/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**tests_all_of_with_one_model_get**](TestingApi.md#tests_all_of_with_one_model_get) | **GET** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) +[**tests_deep_object_free_form_query_param_get**](TestingApi.md#tests_deep_object_free_form_query_param_get) | **GET** /tests/deep-object-free-form-query-param | [**tests_file_response_get**](TestingApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file [**tests_inline_enum_boxing_get**](TestingApi.md#tests_inline_enum_boxing_get) | **GET** /tests/inlineEnumBoxing | Get model with inline enums [**tests_inline_enum_boxing_post**](TestingApi.md#tests_inline_enum_boxing_post) | **POST** /tests/inlineEnumBoxing | Test for inline enum fields not being boxed in model constructors @@ -40,6 +41,36 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## tests_deep_object_free_form_query_param_get + +> tests_deep_object_free_form_query_param_get(scope, filter, extra) + + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**scope** | Option<[**std::collections::HashMap**](String.md)> | | [required] | +**filter** | Option<[**std::collections::HashMap**](String.md)> | | | +**extra** | Option<[**serde_json::Value**](SerdeJson__Value.md)> | | | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + ## tests_file_response_get > std::path::PathBuf tests_file_response_get() diff --git a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/apis/testing_api.rs b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/apis/testing_api.rs index 6cc8c976ba35..c81829959116 100644 --- a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/apis/testing_api.rs @@ -22,6 +22,13 @@ pub enum TestsAllOfWithOneModelGetError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`tests_deep_object_free_form_query_param_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TestsDeepObjectFreeFormQueryParamGetError { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`tests_file_response_get`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -88,6 +95,48 @@ pub fn tests_all_of_with_one_model_get(configuration: &configuration::Configurat } } +pub fn tests_deep_object_free_form_query_param_get(configuration: &configuration::Configuration, scope: Option>, filter: Option>, extra: Option) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_scope = scope; + let p_query_filter = filter; + let p_query_extra = extra; + + let uri_str = format!("{}/tests/deep-object-free-form-query-param", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_filter { + let params = crate::apis::parse_deep_object("filter", &serde_json::to_value(param_value)?); + req_builder = req_builder.query(¶ms); + } + if let Some(ref param_value) = p_query_extra { + let params = crate::apis::parse_deep_object("extra", &serde_json::to_value(param_value)?); + req_builder = req_builder.query(¶ms); + } + if let Some(ref param_value) = p_query_scope { + let params = crate::apis::parse_deep_object("scope", &serde_json::to_value(param_value)?); + req_builder = req_builder.query(¶ms); + }; + if let Some(ref param_value) = p_query_scope { + req_builder = req_builder.query(&[("scope", &serde_json::to_string(param_value)?)]); + }; + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req)?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text()?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + pub fn tests_file_response_get(configuration: &configuration::Configuration, ) -> Result> { let uri_str = format!("{}/tests/fileResponse", configuration.base_path); diff --git a/samples/client/petstore/rust/reqwest/petstore-no-chrono/README.md b/samples/client/petstore/rust/reqwest/petstore-no-chrono/README.md index 790ede098a97..db949b4a32e2 100644 --- a/samples/client/petstore/rust/reqwest/petstore-no-chrono/README.md +++ b/samples/client/petstore/rust/reqwest/petstore-no-chrono/README.md @@ -42,6 +42,7 @@ Class | Method | HTTP request | Description *StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID *StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet *TestingApi* | [**tests_all_of_with_one_model_get**](docs/TestingApi.md#tests_all_of_with_one_model_get) | **GET** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) +*TestingApi* | [**tests_deep_object_free_form_query_param_get**](docs/TestingApi.md#tests_deep_object_free_form_query_param_get) | **GET** /tests/deep-object-free-form-query-param | *TestingApi* | [**tests_file_response_get**](docs/TestingApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file *TestingApi* | [**tests_inline_enum_boxing_get**](docs/TestingApi.md#tests_inline_enum_boxing_get) | **GET** /tests/inlineEnumBoxing | Get model with inline enums *TestingApi* | [**tests_inline_enum_boxing_post**](docs/TestingApi.md#tests_inline_enum_boxing_post) | **POST** /tests/inlineEnumBoxing | Test for inline enum fields not being boxed in model constructors diff --git a/samples/client/petstore/rust/reqwest/petstore-no-chrono/docs/TestingApi.md b/samples/client/petstore/rust/reqwest/petstore-no-chrono/docs/TestingApi.md index a14a8e0c081d..5c2b5941231b 100644 --- a/samples/client/petstore/rust/reqwest/petstore-no-chrono/docs/TestingApi.md +++ b/samples/client/petstore/rust/reqwest/petstore-no-chrono/docs/TestingApi.md @@ -5,6 +5,7 @@ All URIs are relative to *http://localhost/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**tests_all_of_with_one_model_get**](TestingApi.md#tests_all_of_with_one_model_get) | **GET** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) +[**tests_deep_object_free_form_query_param_get**](TestingApi.md#tests_deep_object_free_form_query_param_get) | **GET** /tests/deep-object-free-form-query-param | [**tests_file_response_get**](TestingApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file [**tests_inline_enum_boxing_get**](TestingApi.md#tests_inline_enum_boxing_get) | **GET** /tests/inlineEnumBoxing | Get model with inline enums [**tests_inline_enum_boxing_post**](TestingApi.md#tests_inline_enum_boxing_post) | **POST** /tests/inlineEnumBoxing | Test for inline enum fields not being boxed in model constructors @@ -40,6 +41,36 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## tests_deep_object_free_form_query_param_get + +> tests_deep_object_free_form_query_param_get(scope, filter, extra) + + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**scope** | Option<[**std::collections::HashMap**](String.md)> | | [required] | +**filter** | Option<[**std::collections::HashMap**](String.md)> | | | +**extra** | Option<[**serde_json::Value**](SerdeJson__Value.md)> | | | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + ## tests_file_response_get > std::path::PathBuf tests_file_response_get() diff --git a/samples/client/petstore/rust/reqwest/petstore-no-chrono/src/apis/testing_api.rs b/samples/client/petstore/rust/reqwest/petstore-no-chrono/src/apis/testing_api.rs index f286b427dac9..213d3ed5612f 100644 --- a/samples/client/petstore/rust/reqwest/petstore-no-chrono/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-no-chrono/src/apis/testing_api.rs @@ -22,6 +22,13 @@ pub enum TestsAllOfWithOneModelGetError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`tests_deep_object_free_form_query_param_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TestsDeepObjectFreeFormQueryParamGetError { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`tests_file_response_get`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -88,6 +95,48 @@ pub fn tests_all_of_with_one_model_get(configuration: &configuration::Configurat } } +pub fn tests_deep_object_free_form_query_param_get(configuration: &configuration::Configuration, scope: Option>, filter: Option>, extra: Option) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_scope = scope; + let p_query_filter = filter; + let p_query_extra = extra; + + let uri_str = format!("{}/tests/deep-object-free-form-query-param", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_filter { + let params = crate::apis::parse_deep_object("filter", &serde_json::to_value(param_value)?); + req_builder = req_builder.query(¶ms); + } + if let Some(ref param_value) = p_query_extra { + let params = crate::apis::parse_deep_object("extra", &serde_json::to_value(param_value)?); + req_builder = req_builder.query(¶ms); + } + if let Some(ref param_value) = p_query_scope { + let params = crate::apis::parse_deep_object("scope", &serde_json::to_value(param_value)?); + req_builder = req_builder.query(¶ms); + }; + if let Some(ref param_value) = p_query_scope { + req_builder = req_builder.query(&[("scope", &serde_json::to_string(param_value)?)]); + }; + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req)?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text()?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + pub fn tests_file_response_get(configuration: &configuration::Configuration, ) -> Result> { let uri_str = format!("{}/tests/fileResponse", configuration.base_path); diff --git a/samples/client/petstore/rust/reqwest/petstore-serde-path-to-error/README.md b/samples/client/petstore/rust/reqwest/petstore-serde-path-to-error/README.md index 49732402af49..b39c05645462 100644 --- a/samples/client/petstore/rust/reqwest/petstore-serde-path-to-error/README.md +++ b/samples/client/petstore/rust/reqwest/petstore-serde-path-to-error/README.md @@ -42,6 +42,7 @@ Class | Method | HTTP request | Description *StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID *StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet *TestingApi* | [**tests_all_of_with_one_model_get**](docs/TestingApi.md#tests_all_of_with_one_model_get) | **GET** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) +*TestingApi* | [**tests_deep_object_free_form_query_param_get**](docs/TestingApi.md#tests_deep_object_free_form_query_param_get) | **GET** /tests/deep-object-free-form-query-param | *TestingApi* | [**tests_file_response_get**](docs/TestingApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file *TestingApi* | [**tests_inline_enum_boxing_get**](docs/TestingApi.md#tests_inline_enum_boxing_get) | **GET** /tests/inlineEnumBoxing | Get model with inline enums *TestingApi* | [**tests_inline_enum_boxing_post**](docs/TestingApi.md#tests_inline_enum_boxing_post) | **POST** /tests/inlineEnumBoxing | Test for inline enum fields not being boxed in model constructors diff --git a/samples/client/petstore/rust/reqwest/petstore-serde-path-to-error/docs/TestingApi.md b/samples/client/petstore/rust/reqwest/petstore-serde-path-to-error/docs/TestingApi.md index a14a8e0c081d..5c2b5941231b 100644 --- a/samples/client/petstore/rust/reqwest/petstore-serde-path-to-error/docs/TestingApi.md +++ b/samples/client/petstore/rust/reqwest/petstore-serde-path-to-error/docs/TestingApi.md @@ -5,6 +5,7 @@ All URIs are relative to *http://localhost/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**tests_all_of_with_one_model_get**](TestingApi.md#tests_all_of_with_one_model_get) | **GET** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) +[**tests_deep_object_free_form_query_param_get**](TestingApi.md#tests_deep_object_free_form_query_param_get) | **GET** /tests/deep-object-free-form-query-param | [**tests_file_response_get**](TestingApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file [**tests_inline_enum_boxing_get**](TestingApi.md#tests_inline_enum_boxing_get) | **GET** /tests/inlineEnumBoxing | Get model with inline enums [**tests_inline_enum_boxing_post**](TestingApi.md#tests_inline_enum_boxing_post) | **POST** /tests/inlineEnumBoxing | Test for inline enum fields not being boxed in model constructors @@ -40,6 +41,36 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## tests_deep_object_free_form_query_param_get + +> tests_deep_object_free_form_query_param_get(scope, filter, extra) + + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**scope** | Option<[**std::collections::HashMap**](String.md)> | | [required] | +**filter** | Option<[**std::collections::HashMap**](String.md)> | | | +**extra** | Option<[**serde_json::Value**](SerdeJson__Value.md)> | | | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + ## tests_file_response_get > std::path::PathBuf tests_file_response_get() diff --git a/samples/client/petstore/rust/reqwest/petstore-serde-path-to-error/src/apis/testing_api.rs b/samples/client/petstore/rust/reqwest/petstore-serde-path-to-error/src/apis/testing_api.rs index e8afa6500d14..0949355bca63 100644 --- a/samples/client/petstore/rust/reqwest/petstore-serde-path-to-error/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-serde-path-to-error/src/apis/testing_api.rs @@ -22,6 +22,13 @@ pub enum TestsAllOfWithOneModelGetError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`tests_deep_object_free_form_query_param_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TestsDeepObjectFreeFormQueryParamGetError { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`tests_file_response_get`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -88,6 +95,48 @@ pub async fn tests_all_of_with_one_model_get(configuration: &configuration::Conf } } +pub async fn tests_deep_object_free_form_query_param_get(configuration: &configuration::Configuration, scope: Option>, filter: Option>, extra: Option) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_scope = scope; + let p_query_filter = filter; + let p_query_extra = extra; + + let uri_str = format!("{}/tests/deep-object-free-form-query-param", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_filter { + let params = crate::apis::parse_deep_object("filter", &serde_json::to_value(param_value)?); + req_builder = req_builder.query(¶ms); + } + if let Some(ref param_value) = p_query_extra { + let params = crate::apis::parse_deep_object("extra", &serde_json::to_value(param_value)?); + req_builder = req_builder.query(¶ms); + } + if let Some(ref param_value) = p_query_scope { + let params = crate::apis::parse_deep_object("scope", &serde_json::to_value(param_value)?); + req_builder = req_builder.query(¶ms); + }; + if let Some(ref param_value) = p_query_scope { + req_builder = req_builder.query(&[("scope", &serde_json::to_string(param_value)?)]); + }; + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + pub async fn tests_file_response_get(configuration: &configuration::Configuration, ) -> Result> { let uri_str = format!("{}/tests/fileResponse", configuration.base_path); diff --git a/samples/client/petstore/rust/reqwest/petstore/README.md b/samples/client/petstore/rust/reqwest/petstore/README.md index 296bdd4bd9d0..d8024875abfb 100644 --- a/samples/client/petstore/rust/reqwest/petstore/README.md +++ b/samples/client/petstore/rust/reqwest/petstore/README.md @@ -42,6 +42,7 @@ Class | Method | HTTP request | Description *StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID *StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet *TestingApi* | [**tests_all_of_with_one_model_get**](docs/TestingApi.md#tests_all_of_with_one_model_get) | **GET** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) +*TestingApi* | [**tests_deep_object_free_form_query_param_get**](docs/TestingApi.md#tests_deep_object_free_form_query_param_get) | **GET** /tests/deep-object-free-form-query-param | *TestingApi* | [**tests_file_response_get**](docs/TestingApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file *TestingApi* | [**tests_inline_enum_boxing_get**](docs/TestingApi.md#tests_inline_enum_boxing_get) | **GET** /tests/inlineEnumBoxing | Get model with inline enums *TestingApi* | [**tests_inline_enum_boxing_post**](docs/TestingApi.md#tests_inline_enum_boxing_post) | **POST** /tests/inlineEnumBoxing | Test for inline enum fields not being boxed in model constructors diff --git a/samples/client/petstore/rust/reqwest/petstore/docs/TestingApi.md b/samples/client/petstore/rust/reqwest/petstore/docs/TestingApi.md index a14a8e0c081d..5c2b5941231b 100644 --- a/samples/client/petstore/rust/reqwest/petstore/docs/TestingApi.md +++ b/samples/client/petstore/rust/reqwest/petstore/docs/TestingApi.md @@ -5,6 +5,7 @@ All URIs are relative to *http://localhost/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**tests_all_of_with_one_model_get**](TestingApi.md#tests_all_of_with_one_model_get) | **GET** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) +[**tests_deep_object_free_form_query_param_get**](TestingApi.md#tests_deep_object_free_form_query_param_get) | **GET** /tests/deep-object-free-form-query-param | [**tests_file_response_get**](TestingApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file [**tests_inline_enum_boxing_get**](TestingApi.md#tests_inline_enum_boxing_get) | **GET** /tests/inlineEnumBoxing | Get model with inline enums [**tests_inline_enum_boxing_post**](TestingApi.md#tests_inline_enum_boxing_post) | **POST** /tests/inlineEnumBoxing | Test for inline enum fields not being boxed in model constructors @@ -40,6 +41,36 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## tests_deep_object_free_form_query_param_get + +> tests_deep_object_free_form_query_param_get(scope, filter, extra) + + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**scope** | Option<[**std::collections::HashMap**](String.md)> | | [required] | +**filter** | Option<[**std::collections::HashMap**](String.md)> | | | +**extra** | Option<[**serde_json::Value**](SerdeJson__Value.md)> | | | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + ## tests_file_response_get > std::path::PathBuf tests_file_response_get() diff --git a/samples/client/petstore/rust/reqwest/petstore/src/apis/testing_api.rs b/samples/client/petstore/rust/reqwest/petstore/src/apis/testing_api.rs index f286b427dac9..213d3ed5612f 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/apis/testing_api.rs @@ -22,6 +22,13 @@ pub enum TestsAllOfWithOneModelGetError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`tests_deep_object_free_form_query_param_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TestsDeepObjectFreeFormQueryParamGetError { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`tests_file_response_get`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -88,6 +95,48 @@ pub fn tests_all_of_with_one_model_get(configuration: &configuration::Configurat } } +pub fn tests_deep_object_free_form_query_param_get(configuration: &configuration::Configuration, scope: Option>, filter: Option>, extra: Option) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_scope = scope; + let p_query_filter = filter; + let p_query_extra = extra; + + let uri_str = format!("{}/tests/deep-object-free-form-query-param", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_filter { + let params = crate::apis::parse_deep_object("filter", &serde_json::to_value(param_value)?); + req_builder = req_builder.query(¶ms); + } + if let Some(ref param_value) = p_query_extra { + let params = crate::apis::parse_deep_object("extra", &serde_json::to_value(param_value)?); + req_builder = req_builder.query(¶ms); + } + if let Some(ref param_value) = p_query_scope { + let params = crate::apis::parse_deep_object("scope", &serde_json::to_value(param_value)?); + req_builder = req_builder.query(¶ms); + }; + if let Some(ref param_value) = p_query_scope { + req_builder = req_builder.query(&[("scope", &serde_json::to_string(param_value)?)]); + }; + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req)?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text()?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + pub fn tests_file_response_get(configuration: &configuration::Configuration, ) -> Result> { let uri_str = format!("{}/tests/fileResponse", configuration.base_path);