From 3b511af95a51cac73297044a6e30997649ef73d5 Mon Sep 17 00:00:00 2001 From: Wiebren Braakman Date: Tue, 8 Sep 2026 11:10:00 +0200 Subject: [PATCH 1/4] [rust] fix: exploded deepObject free-form query parameters do not compile The exploded deepObject branch walks every map-flagged parameter with .len()/.iter() - fine for a HashMap-typed map (an object schema with declared additionalProperties), but a bare free-form object is a serde_json::Value, which has neither, so the generated crate did not compile. Split the branch on isContainer and walk the Value through as_object(): a non-object Value sends nothing, matching the parameter's declared object shape. The second of the two follow-ups promised in #24866's body. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01GcwZ1arjLZNpetHz2a3TJz --- .../resources/rust/reqwest-trait/api.mustache | 24 ++++++++++++++++++ .../main/resources/rust/reqwest/api.mustache | 24 ++++++++++++++++++ .../codegen/rust/RustClientCodegenTest.java | 25 +++++++++++++++++++ .../deep-object-free-form-query-param.yaml | 25 +++++++++++++++++++ 4 files changed, 98 insertions(+) create mode 100644 modules/openapi-generator/src/test/resources/3_0/rust/deep-object-free-form-query-param.yaml 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 cf16c0fc24b2..2a593c656587 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,23 @@ impl {{classname}} for {{classname}}Client { {{/isModel}} {{#isMap}} if let Some(ref param_value) = {{{paramName}}} { + {{#isContainer}} 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); + {{/isContainer}} + {{^isContainer}} + // a free-form object is a serde_json::Value, only walkable through as_object() + if let Some(object) = param_value.as_object() { + let mut query_params = Vec::with_capacity(object.len()); + for (key, value) in object.iter() { + query_params.push((key.to_string(), serde_json::to_string(value)?)); + } + local_var_req_builder = local_var_req_builder.query(&query_params); + } + {{/isContainer}} } {{/isMap}} {{/isExplode}} @@ -256,11 +268,23 @@ impl {{classname}} for {{classname}}Client { local_var_req_builder = local_var_req_builder.query(¶m_value); {{/isModel}} {{#isMap}} + {{#isContainer}} 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); + {{/isContainer}} + {{^isContainer}} + // a free-form object is a serde_json::Value, only walkable through as_object() + if let Some(object) = param_value.as_object() { + let mut query_params = Vec::with_capacity(object.len()); + for (key, value) in object.iter() { + query_params.push((key.to_string(), serde_json::to_string(value)?)); + } + local_var_req_builder = local_var_req_builder.query(&query_params); + } + {{/isContainer}} {{/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..95b29699d1d9 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,23 @@ pub {{#supportAsync}}async {{/supportAsync}}fn {{{operationId}}}(configuration: req_builder = req_builder.query(¶m_value); {{/isModel}} {{#isMap}} + {{#isContainer}} 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); + {{/isContainer}} + {{^isContainer}} + // a free-form object is a serde_json::Value, only walkable through as_object() + if let Some(object) = param_value.as_object() { + let mut query_params = Vec::with_capacity(object.len()); + for (key, value) in object.iter() { + query_params.push((key.to_string(), serde_json::to_string(value)?)); + } + req_builder = req_builder.query(&query_params); + } + {{/isContainer}} {{/isMap}} {{/isExplode}} }; @@ -251,11 +263,23 @@ pub {{#supportAsync}}async {{/supportAsync}}fn {{{operationId}}}(configuration: req_builder = req_builder.query(¶m_value); {{/isModel}} {{#isMap}} + {{#isContainer}} 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); + {{/isContainer}} + {{^isContainer}} + // a free-form object is a serde_json::Value, only walkable through as_object() + if let Some(object) = param_value.as_object() { + let mut query_params = Vec::with_capacity(object.len()); + for (key, value) in object.iter() { + query_params.push((key.to_string(), serde_json::to_string(value)?)); + } + req_builder = req_builder.query(&query_params); + } + {{/isContainer}} {{/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 d4bc7c1845ec..1731b3716e31 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 @@ -293,6 +293,31 @@ public void testIntegerPropertyEnum() throws IOException { TestUtils.assertFileNotContains(outputPath, linearize("#[serde(rename = \"0\")]")); } + @Test + public void testDeepObjectFreeFormQueryParamCompiles() throws IOException { + // the exploded deepObject branch walked every map-flagged parameter with + // .len()/.iter() - fine for a HashMap-typed map, but a bare free-form object is a + // serde_json::Value, which has neither, so the generated crate did not compile + 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("\\", "/")); + new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); + Path outputPath = Path.of(target.toString(), "/src/apis/default_api.rs"); + TestUtils.assertFileExists(outputPath); + // the free-form parameter walks the Value through as_object(); the typed map + // keeps its direct iteration + TestUtils.assertFileContains(outputPath, "param_value.as_object()"); + TestUtils.assertFileContains(outputPath, "for (key, value) in param_value.iter()"); + TestUtils.assertFileContains(outputPath, "for (key, value) in object.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..b69ddf58b717 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/rust/deep-object-free-form-query-param.yaml @@ -0,0 +1,25 @@ +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: true + - name: extra + in: query + style: deepObject + explode: true + schema: + type: object + responses: + '200': + description: ok From 35907595e1e46abdc8539c3a501e213369d6add0 Mon Sep 17 00:00:00 2001 From: Wiebren Braakman Date: Tue, 8 Sep 2026 11:38:38 +0200 Subject: [PATCH 2/4] [rust] rework: route exploded deepObject maps through parse_deep_object Review pointed out the branch emitted unprefixed json-quoted pairs - not the deepObject wire format the style asks for - and that was true of the pre-existing HashMap iteration too. Both shapes (typed map and free-form serde_json::Value) now take crate::apis::parse_deep_object, the route the non-explode branch already uses: name[key]=value on the wire, one code path, and the Value shape compiles because to_value accepts both. The fixture gains a required-nullable parameter so all patched sites are exercised, and the test registers the generated tree for cleanup. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01GcwZ1arjLZNpetHz2a3TJz --- .../resources/rust/reqwest-trait/api.mustache | 42 ++++--------------- .../main/resources/rust/reqwest/api.mustache | 42 ++++--------------- .../codegen/rust/RustClientCodegenTest.java | 19 +++++---- .../deep-object-free-form-query-param.yaml | 10 +++++ 4 files changed, 38 insertions(+), 75 deletions(-) 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 2a593c656587..093832d31435 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 @@ -205,24 +205,11 @@ impl {{classname}} for {{classname}}Client { } {{/isModel}} {{#isMap}} + {{!-- one route for the HashMap and the free-form serde_json::Value shape alike, + and the same deepObject wire format the non-explode branch produces --}} if let Some(ref param_value) = {{{paramName}}} { - {{#isContainer}} - 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); - {{/isContainer}} - {{^isContainer}} - // a free-form object is a serde_json::Value, only walkable through as_object() - if let Some(object) = param_value.as_object() { - let mut query_params = Vec::with_capacity(object.len()); - for (key, value) in object.iter() { - query_params.push((key.to_string(), serde_json::to_string(value)?)); - } - local_var_req_builder = local_var_req_builder.query(&query_params); - } - {{/isContainer}} + 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}} @@ -268,23 +255,10 @@ impl {{classname}} for {{classname}}Client { local_var_req_builder = local_var_req_builder.query(¶m_value); {{/isModel}} {{#isMap}} - {{#isContainer}} - 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); - {{/isContainer}} - {{^isContainer}} - // a free-form object is a serde_json::Value, only walkable through as_object() - if let Some(object) = param_value.as_object() { - let mut query_params = Vec::with_capacity(object.len()); - for (key, value) in object.iter() { - query_params.push((key.to_string(), serde_json::to_string(value)?)); - } - local_var_req_builder = local_var_req_builder.query(&query_params); - } - {{/isContainer}} + {{!-- one route for the HashMap and the free-form serde_json::Value shape alike, + and the same deepObject wire format the non-explode branch produces --}} + 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 95b29699d1d9..8b363e700593 100644 --- a/modules/openapi-generator/src/main/resources/rust/reqwest/api.mustache +++ b/modules/openapi-generator/src/main/resources/rust/reqwest/api.mustache @@ -180,23 +180,10 @@ pub {{#supportAsync}}async {{/supportAsync}}fn {{{operationId}}}(configuration: req_builder = req_builder.query(¶m_value); {{/isModel}} {{#isMap}} - {{#isContainer}} - 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); - {{/isContainer}} - {{^isContainer}} - // a free-form object is a serde_json::Value, only walkable through as_object() - if let Some(object) = param_value.as_object() { - let mut query_params = Vec::with_capacity(object.len()); - for (key, value) in object.iter() { - query_params.push((key.to_string(), serde_json::to_string(value)?)); - } - req_builder = req_builder.query(&query_params); - } - {{/isContainer}} + {{!-- one route for the HashMap and the free-form serde_json::Value shape alike, + and the same deepObject wire format the non-explode branch produces --}} + let params = crate::apis::parse_deep_object("{{{baseName}}}", &serde_json::to_value(param_value)?); + req_builder = req_builder.query(¶ms); {{/isMap}} {{/isExplode}} }; @@ -263,23 +250,10 @@ pub {{#supportAsync}}async {{/supportAsync}}fn {{{operationId}}}(configuration: req_builder = req_builder.query(¶m_value); {{/isModel}} {{#isMap}} - {{#isContainer}} - 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); - {{/isContainer}} - {{^isContainer}} - // a free-form object is a serde_json::Value, only walkable through as_object() - if let Some(object) = param_value.as_object() { - let mut query_params = Vec::with_capacity(object.len()); - for (key, value) in object.iter() { - query_params.push((key.to_string(), serde_json::to_string(value)?)); - } - req_builder = req_builder.query(&query_params); - } - {{/isContainer}} + {{!-- one route for the HashMap and the free-form serde_json::Value shape alike, + and the same deepObject wire format the non-explode branch produces --}} + 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 1731b3716e31..bebb54132710 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 @@ -297,7 +297,9 @@ public void testIntegerPropertyEnum() throws IOException { public void testDeepObjectFreeFormQueryParamCompiles() throws IOException { // the exploded deepObject branch walked every map-flagged parameter with // .len()/.iter() - fine for a HashMap-typed map, but a bare free-form object is a - // serde_json::Value, which has neither, so the generated crate did not compile + // serde_json::Value, which has neither, so the generated crate did not compile; + // both shapes now take parse_deep_object, the route the non-explode branch already + // uses, which also yields the deepObject wire format the style asks for for (String library : new String[] {"reqwest", "reqwest-trait"}) { Path target = Files.createTempDirectory("test"); target.toFile().deleteOnExit(); @@ -307,14 +309,17 @@ public void testDeepObjectFreeFormQueryParamCompiles() throws IOException { .setInputSpec("src/test/resources/3_0/rust/deep-object-free-form-query-param.yaml") .setSkipOverwrite(false) .setOutputDir(target.toAbsolutePath().toString().replace("\\", "/")); - new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); + 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); - // the free-form parameter walks the Value through as_object(); the typed map - // keeps its direct iteration - TestUtils.assertFileContains(outputPath, "param_value.as_object()"); - TestUtils.assertFileContains(outputPath, "for (key, value) in param_value.iter()"); - TestUtils.assertFileContains(outputPath, "for (key, value) in object.iter()"); + // the optional typed map, the optional free-form object, and the + // required-nullable map all route through parse_deep_object + 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()"); } } 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 index b69ddf58b717..5780ef2bf2da 100644 --- 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 @@ -20,6 +20,16 @@ paths: 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 From cd96cf80b5d4d2f90869eb841aebbe08ddb674f6 Mon Sep 17 00:00:00 2001 From: Wiebren Braakman Date: Wed, 23 Sep 2026 09:12:57 +0200 Subject: [PATCH 3/4] [rust] tidy: drop narrating template comments, pin the typed-map wire shape The four comment copies repeated what the identical non-explode block already says. The test is renamed for what it checks, and the fixture's `filter` becomes a typed map (`additionalProperties: {type: string}`), the shape whose wire format this change affects. Co-Authored-By: Claude Opus 5.5 (1M context) --- .../main/resources/rust/reqwest-trait/api.mustache | 4 ---- .../src/main/resources/rust/reqwest/api.mustache | 4 ---- .../codegen/rust/RustClientCodegenTest.java | 11 +++-------- .../3_0/rust/deep-object-free-form-query-param.yaml | 3 ++- 4 files changed, 5 insertions(+), 17 deletions(-) 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 093832d31435..1841483e7158 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 @@ -205,8 +205,6 @@ impl {{classname}} for {{classname}}Client { } {{/isModel}} {{#isMap}} - {{!-- one route for the HashMap and the free-form serde_json::Value shape alike, - and the same deepObject wire format the non-explode branch produces --}} if let Some(ref param_value) = {{{paramName}}} { let params = crate::apis::parse_deep_object("{{{baseName}}}", &serde_json::to_value(param_value)?); local_var_req_builder = local_var_req_builder.query(¶ms); @@ -255,8 +253,6 @@ impl {{classname}} for {{classname}}Client { local_var_req_builder = local_var_req_builder.query(¶m_value); {{/isModel}} {{#isMap}} - {{!-- one route for the HashMap and the free-form serde_json::Value shape alike, - and the same deepObject wire format the non-explode branch produces --}} 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}} 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 8b363e700593..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,8 +180,6 @@ pub {{#supportAsync}}async {{/supportAsync}}fn {{{operationId}}}(configuration: req_builder = req_builder.query(¶m_value); {{/isModel}} {{#isMap}} - {{!-- one route for the HashMap and the free-form serde_json::Value shape alike, - and the same deepObject wire format the non-explode branch produces --}} let params = crate::apis::parse_deep_object("{{{baseName}}}", &serde_json::to_value(param_value)?); req_builder = req_builder.query(¶ms); {{/isMap}} @@ -250,8 +248,6 @@ pub {{#supportAsync}}async {{/supportAsync}}fn {{{operationId}}}(configuration: req_builder = req_builder.query(¶m_value); {{/isModel}} {{#isMap}} - {{!-- one route for the HashMap and the free-form serde_json::Value shape alike, - and the same deepObject wire format the non-explode branch produces --}} let params = crate::apis::parse_deep_object("{{{baseName}}}", &serde_json::to_value(param_value)?); req_builder = req_builder.query(¶ms); {{/isMap}} 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 bebb54132710..06ce6fc663d5 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 @@ -294,12 +294,8 @@ public void testIntegerPropertyEnum() throws IOException { } @Test - public void testDeepObjectFreeFormQueryParamCompiles() throws IOException { - // the exploded deepObject branch walked every map-flagged parameter with - // .len()/.iter() - fine for a HashMap-typed map, but a bare free-form object is a - // serde_json::Value, which has neither, so the generated crate did not compile; - // both shapes now take parse_deep_object, the route the non-explode branch already - // uses, which also yields the deepObject wire format the style asks for + 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(); @@ -313,8 +309,7 @@ public void testDeepObjectFreeFormQueryParamCompiles() throws IOException { files.forEach(File::deleteOnExit); Path outputPath = Path.of(target.toString(), "/src/apis/default_api.rs"); TestUtils.assertFileExists(outputPath); - // the optional typed map, the optional free-form object, and the - // required-nullable map all route through parse_deep_object + // 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\""); 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 index 5780ef2bf2da..0a2c992091a4 100644 --- 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 @@ -13,7 +13,8 @@ paths: explode: true schema: type: object - additionalProperties: true + additionalProperties: + type: string - name: extra in: query style: deepObject From ce26f3626c778113f10299777489fdf277fd4a4c Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 25 Sep 2026 11:47:54 +0800 Subject: [PATCH 4/4] add tests for deep object free form query param --- .../src/test/resources/3_0/rust/petstore.yaml | 33 ++++++++++ .../petstore/rust/hyper/petstore/README.md | 1 + .../rust/hyper/petstore/docs/TestingApi.md | 31 +++++++++ .../hyper/petstore/src/apis/testing_api.rs | 28 +++++++++ .../petstore/rust/hyper0x/petstore/README.md | 1 + .../rust/hyper0x/petstore/docs/TestingApi.md | 31 +++++++++ .../hyper0x/petstore/src/apis/testing_api.rs | 28 +++++++++ .../rust/reqwest-trait/petstore/README.md | 1 + .../reqwest-trait/petstore/docs/TestingApi.md | 31 +++++++++ .../petstore/src/apis/testing_api.rs | 51 +++++++++++++++ .../petstore-async-middleware/README.md | 1 + .../docs/TestingApi.md | 31 +++++++++ .../src/apis/testing_api.rs | 63 +++++++++++++++++++ .../petstore-async-tokensource/README.md | 1 + .../docs/TestingApi.md | 31 +++++++++ .../src/apis/testing_api.rs | 63 +++++++++++++++++++ .../rust/reqwest/petstore-async/README.md | 1 + .../reqwest/petstore-async/docs/TestingApi.md | 31 +++++++++ .../petstore-async/src/apis/testing_api.rs | 63 +++++++++++++++++++ .../rust/reqwest/petstore-avoid-box/README.md | 1 + .../petstore-avoid-box/docs/TestingApi.md | 31 +++++++++ .../src/apis/testing_api.rs | 63 +++++++++++++++++++ .../reqwest/petstore-awsv4signature/README.md | 1 + .../docs/TestingApi.md | 31 +++++++++ .../src/apis/testing_api.rs | 49 +++++++++++++++ .../petstore-model-name-prefix/README.md | 1 + .../docs/TestingApi.md | 31 +++++++++ .../src/apis/testing_api.rs | 49 +++++++++++++++ .../rust/reqwest/petstore-no-chrono/README.md | 1 + .../petstore-no-chrono/docs/TestingApi.md | 31 +++++++++ .../src/apis/testing_api.rs | 49 +++++++++++++++ .../petstore-serde-path-to-error/README.md | 1 + .../docs/TestingApi.md | 31 +++++++++ .../src/apis/testing_api.rs | 49 +++++++++++++++ .../petstore/rust/reqwest/petstore/README.md | 1 + .../rust/reqwest/petstore/docs/TestingApi.md | 31 +++++++++ .../reqwest/petstore/src/apis/testing_api.rs | 49 +++++++++++++++ 37 files changed, 1021 insertions(+) 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);