From 0d0a3d0006a4fde3f923c6b4808386d45eda30c6 Mon Sep 17 00:00:00 2001 From: Ross Sullivan Date: Tue, 29 Apr 2025 12:39:29 +0900 Subject: [PATCH 1/5] fix: Remove duplicate oneOf schemas during pre-processing --- .../org/openapitools/codegen/DefaultCodegen.java | 8 ++++++++ .../org/openapitools/codegen/utils/ModelUtils.java | 13 +++++++++++++ 2 files changed, 21 insertions(+) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index b3cbca3dd93d..7d6fc7ffca40 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -1009,6 +1009,14 @@ public void postProcessParameter(CodegenParameter parameter) { @Override @SuppressWarnings("unused") public void preprocessOpenAPI(OpenAPI openAPI) { + if (openAPI.getComponents() != null) { + // Remove duplicate oneOf + Map schemas = new HashMap<>(openAPI.getComponents().getSchemas()); + for (var schema : schemas.values()) { + ModelUtils.deduplicateOneOfSchema(schema); + } + } + if (useOneOfInterfaces && openAPI.getComponents() != null) { // we process the openapi schema here to find oneOf schemas and create interface models for them Map schemas = new HashMap<>(openAPI.getComponents().getSchemas()); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java index e1f9a9325888..7bfb1c31dca2 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java @@ -2243,6 +2243,19 @@ public static Schema simplyOneOfAnyOfWithOnlyOneNonNullSubSchema(OpenAPI openAPI return schema; } + /** + * Removes duplicate `oneOf` from a given schema + * + * @param schema Schema + */ + public static void deduplicateOneOfSchema(Schema schema) { + if (schema.getOneOf() == null) { + return; + } + Set deduplicated = new LinkedHashSet<>(schema.getOneOf()); + schema.setOneOf(new ArrayList<>(deduplicated)); + } + /** * Check if the schema is of type 'null' or schema itself is pointing to null *

From e0977a38c18eaea760fc66253ab27764a054a3fc Mon Sep 17 00:00:00 2001 From: Ross Sullivan Date: Tue, 29 Apr 2025 12:48:22 +0900 Subject: [PATCH 2/5] chore: Updated samples --- .../src/test/resources/3_0/rust/petstore.yaml | 13 ++++++ .../hyper/oneOf-reuseRef/src/models/fruit.rs | 2 - .../oneOf-reuseRef/src/models/fruit.rs | 2 - .../hyper/petstore/.openapi-generator/FILES | 6 +++ .../petstore/rust/hyper/petstore/README.md | 3 ++ .../hyper/petstore/docs/DuplicateOneOf.md | 11 +++++ .../hyper/petstore/docs/WithInnerOneOf.md | 11 +++++ .../hyper/petstore/docs/WithInnerOneOfFoo.md | 11 +++++ .../petstore/src/models/duplicate_one_of.rs | 41 +++++++++++++++++++ .../rust/hyper/petstore/src/models/mod.rs | 6 +++ .../petstore/src/models/with_inner_one_of.rs | 27 ++++++++++++ .../src/models/with_inner_one_of_foo.rs | 41 +++++++++++++++++++ .../hyper0x/petstore/.openapi-generator/FILES | 6 +++ .../petstore/rust/hyper0x/petstore/README.md | 3 ++ .../hyper0x/petstore/docs/DuplicateOneOf.md | 11 +++++ .../hyper0x/petstore/docs/WithInnerOneOf.md | 11 +++++ .../petstore/docs/WithInnerOneOfFoo.md | 11 +++++ .../petstore/src/models/duplicate_one_of.rs | 41 +++++++++++++++++++ .../rust/hyper0x/petstore/src/models/mod.rs | 6 +++ .../petstore/src/models/with_inner_one_of.rs | 27 ++++++++++++ .../src/models/with_inner_one_of_foo.rs | 41 +++++++++++++++++++ .../petstore/.openapi-generator/FILES | 6 +++ .../rust/reqwest-trait/petstore/README.md | 3 ++ .../petstore/docs/DuplicateOneOf.md | 11 +++++ .../petstore/docs/WithInnerOneOf.md | 11 +++++ .../petstore/docs/WithInnerOneOfFoo.md | 11 +++++ .../petstore/src/models/duplicate_one_of.rs | 41 +++++++++++++++++++ .../reqwest-trait/petstore/src/models/mod.rs | 6 +++ .../petstore/src/models/with_inner_one_of.rs | 27 ++++++++++++ .../src/models/with_inner_one_of_foo.rs | 41 +++++++++++++++++++ .../.openapi-generator/FILES | 6 +++ .../petstore-async-middleware/README.md | 3 ++ .../docs/DuplicateOneOf.md | 11 +++++ .../docs/WithInnerOneOf.md | 11 +++++ .../docs/WithInnerOneOfFoo.md | 11 +++++ .../src/models/duplicate_one_of.rs | 41 +++++++++++++++++++ .../src/models/mod.rs | 6 +++ .../src/models/with_inner_one_of.rs | 27 ++++++++++++ .../src/models/with_inner_one_of_foo.rs | 41 +++++++++++++++++++ .../.openapi-generator/FILES | 6 +++ .../petstore-async-tokensource/README.md | 3 ++ .../docs/DuplicateOneOf.md | 11 +++++ .../docs/WithInnerOneOf.md | 11 +++++ .../docs/WithInnerOneOfFoo.md | 11 +++++ .../src/models/duplicate_one_of.rs | 41 +++++++++++++++++++ .../src/models/mod.rs | 6 +++ .../src/models/with_inner_one_of.rs | 27 ++++++++++++ .../src/models/with_inner_one_of_foo.rs | 41 +++++++++++++++++++ .../petstore-async/.openapi-generator/FILES | 6 +++ .../rust/reqwest/petstore-async/README.md | 3 ++ .../petstore-async/docs/DuplicateOneOf.md | 11 +++++ .../petstore-async/docs/WithInnerOneOf.md | 11 +++++ .../petstore-async/docs/WithInnerOneOfFoo.md | 11 +++++ .../src/models/duplicate_one_of.rs | 41 +++++++++++++++++++ .../reqwest/petstore-async/src/models/mod.rs | 6 +++ .../src/models/with_inner_one_of.rs | 27 ++++++++++++ .../src/models/with_inner_one_of_foo.rs | 41 +++++++++++++++++++ .../.openapi-generator/FILES | 6 +++ .../rust/reqwest/petstore-avoid-box/README.md | 3 ++ .../petstore-avoid-box/docs/DuplicateOneOf.md | 11 +++++ .../petstore-avoid-box/docs/WithInnerOneOf.md | 11 +++++ .../docs/WithInnerOneOfFoo.md | 11 +++++ .../src/models/duplicate_one_of.rs | 41 +++++++++++++++++++ .../petstore-avoid-box/src/models/mod.rs | 6 +++ .../src/models/with_inner_one_of.rs | 27 ++++++++++++ .../src/models/with_inner_one_of_foo.rs | 41 +++++++++++++++++++ .../.openapi-generator/FILES | 6 +++ .../reqwest/petstore-awsv4signature/README.md | 3 ++ .../docs/DuplicateOneOf.md | 11 +++++ .../docs/WithInnerOneOf.md | 11 +++++ .../docs/WithInnerOneOfFoo.md | 11 +++++ .../src/models/duplicate_one_of.rs | 41 +++++++++++++++++++ .../petstore-awsv4signature/src/models/mod.rs | 6 +++ .../src/models/with_inner_one_of.rs | 27 ++++++++++++ .../src/models/with_inner_one_of_foo.rs | 41 +++++++++++++++++++ .../.openapi-generator/FILES | 6 +++ .../petstore-model-name-prefix/README.md | 3 ++ .../docs/FooDuplicateOneOf.md | 11 +++++ .../docs/FooWithInnerOneOf.md | 11 +++++ .../docs/FooWithInnerOneOfFoo.md | 11 +++++ .../src/models/foo_duplicate_one_of.rs | 41 +++++++++++++++++++ .../src/models/foo_with_inner_one_of.rs | 27 ++++++++++++ .../src/models/foo_with_inner_one_of_foo.rs | 41 +++++++++++++++++++ .../src/models/mod.rs | 6 +++ .../reqwest/petstore/.openapi-generator/FILES | 6 +++ .../petstore/rust/reqwest/petstore/README.md | 3 ++ .../reqwest/petstore/docs/DuplicateOneOf.md | 11 +++++ .../reqwest/petstore/docs/WithInnerOneOf.md | 11 +++++ .../petstore/docs/WithInnerOneOfFoo.md | 11 +++++ .../petstore/src/models/duplicate_one_of.rs | 41 +++++++++++++++++++ .../rust/reqwest/petstore/src/models/mod.rs | 6 +++ .../petstore/src/models/with_inner_one_of.rs | 27 ++++++++++++ .../src/models/with_inner_one_of_foo.rs | 41 +++++++++++++++++++ 93 files changed, 1583 insertions(+), 4 deletions(-) create mode 100644 samples/client/petstore/rust/hyper/petstore/docs/DuplicateOneOf.md create mode 100644 samples/client/petstore/rust/hyper/petstore/docs/WithInnerOneOf.md create mode 100644 samples/client/petstore/rust/hyper/petstore/docs/WithInnerOneOfFoo.md create mode 100644 samples/client/petstore/rust/hyper/petstore/src/models/duplicate_one_of.rs create mode 100644 samples/client/petstore/rust/hyper/petstore/src/models/with_inner_one_of.rs create mode 100644 samples/client/petstore/rust/hyper/petstore/src/models/with_inner_one_of_foo.rs create mode 100644 samples/client/petstore/rust/hyper0x/petstore/docs/DuplicateOneOf.md create mode 100644 samples/client/petstore/rust/hyper0x/petstore/docs/WithInnerOneOf.md create mode 100644 samples/client/petstore/rust/hyper0x/petstore/docs/WithInnerOneOfFoo.md create mode 100644 samples/client/petstore/rust/hyper0x/petstore/src/models/duplicate_one_of.rs create mode 100644 samples/client/petstore/rust/hyper0x/petstore/src/models/with_inner_one_of.rs create mode 100644 samples/client/petstore/rust/hyper0x/petstore/src/models/with_inner_one_of_foo.rs create mode 100644 samples/client/petstore/rust/reqwest-trait/petstore/docs/DuplicateOneOf.md create mode 100644 samples/client/petstore/rust/reqwest-trait/petstore/docs/WithInnerOneOf.md create mode 100644 samples/client/petstore/rust/reqwest-trait/petstore/docs/WithInnerOneOfFoo.md create mode 100644 samples/client/petstore/rust/reqwest-trait/petstore/src/models/duplicate_one_of.rs create mode 100644 samples/client/petstore/rust/reqwest-trait/petstore/src/models/with_inner_one_of.rs create mode 100644 samples/client/petstore/rust/reqwest-trait/petstore/src/models/with_inner_one_of_foo.rs create mode 100644 samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/DuplicateOneOf.md create mode 100644 samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/WithInnerOneOf.md create mode 100644 samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/WithInnerOneOfFoo.md create mode 100644 samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/duplicate_one_of.rs create mode 100644 samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/with_inner_one_of.rs create mode 100644 samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/with_inner_one_of_foo.rs create mode 100644 samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/DuplicateOneOf.md create mode 100644 samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/WithInnerOneOf.md create mode 100644 samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/WithInnerOneOfFoo.md create mode 100644 samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/duplicate_one_of.rs create mode 100644 samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/with_inner_one_of.rs create mode 100644 samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/with_inner_one_of_foo.rs create mode 100644 samples/client/petstore/rust/reqwest/petstore-async/docs/DuplicateOneOf.md create mode 100644 samples/client/petstore/rust/reqwest/petstore-async/docs/WithInnerOneOf.md create mode 100644 samples/client/petstore/rust/reqwest/petstore-async/docs/WithInnerOneOfFoo.md create mode 100644 samples/client/petstore/rust/reqwest/petstore-async/src/models/duplicate_one_of.rs create mode 100644 samples/client/petstore/rust/reqwest/petstore-async/src/models/with_inner_one_of.rs create mode 100644 samples/client/petstore/rust/reqwest/petstore-async/src/models/with_inner_one_of_foo.rs create mode 100644 samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/DuplicateOneOf.md create mode 100644 samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/WithInnerOneOf.md create mode 100644 samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/WithInnerOneOfFoo.md create mode 100644 samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/duplicate_one_of.rs create mode 100644 samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/with_inner_one_of.rs create mode 100644 samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/with_inner_one_of_foo.rs create mode 100644 samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/DuplicateOneOf.md create mode 100644 samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/WithInnerOneOf.md create mode 100644 samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/WithInnerOneOfFoo.md create mode 100644 samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/duplicate_one_of.rs create mode 100644 samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/with_inner_one_of.rs create mode 100644 samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/with_inner_one_of_foo.rs create mode 100644 samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/FooDuplicateOneOf.md create mode 100644 samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/FooWithInnerOneOf.md create mode 100644 samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/FooWithInnerOneOfFoo.md create mode 100644 samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/foo_duplicate_one_of.rs create mode 100644 samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/foo_with_inner_one_of.rs create mode 100644 samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/foo_with_inner_one_of_foo.rs create mode 100644 samples/client/petstore/rust/reqwest/petstore/docs/DuplicateOneOf.md create mode 100644 samples/client/petstore/rust/reqwest/petstore/docs/WithInnerOneOf.md create mode 100644 samples/client/petstore/rust/reqwest/petstore/docs/WithInnerOneOfFoo.md create mode 100644 samples/client/petstore/rust/reqwest/petstore/src/models/duplicate_one_of.rs create mode 100644 samples/client/petstore/rust/reqwest/petstore/src/models/with_inner_one_of.rs create mode 100644 samples/client/petstore/rust/reqwest/petstore/src/models/with_inner_one_of_foo.rs 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 3e49f5606d1e..64de2e9e67ce 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 @@ -1107,3 +1107,16 @@ components: allOf: - $ref: '#/components/schemas/existing_tags_array' - description: This is a test for allOf with metadata only fields + DuplicateOneOf: + type: object + oneOf: + - $ref: '#/components/schemas/Order' + - $ref: '#/components/schemas/Order' + WithInnerOneOf: + type: object + properties: + foo: + type: object + oneOf: + - $ref: '#/components/schemas/Order' + - $ref: '#/components/schemas/Order' diff --git a/samples/client/others/rust/hyper/oneOf-reuseRef/src/models/fruit.rs b/samples/client/others/rust/hyper/oneOf-reuseRef/src/models/fruit.rs index cd28f15520c0..5073f25dab84 100644 --- a/samples/client/others/rust/hyper/oneOf-reuseRef/src/models/fruit.rs +++ b/samples/client/others/rust/hyper/oneOf-reuseRef/src/models/fruit.rs @@ -16,8 +16,6 @@ use serde::{Deserialize, Serialize}; pub enum Fruit { #[serde(rename="green_apple")] GreenApple(Box), - #[serde(rename="red_apple")] - RedApple(Box), #[serde(rename="banana")] Banana(Box), } diff --git a/samples/client/others/rust/reqwest/oneOf-reuseRef/src/models/fruit.rs b/samples/client/others/rust/reqwest/oneOf-reuseRef/src/models/fruit.rs index cd28f15520c0..5073f25dab84 100644 --- a/samples/client/others/rust/reqwest/oneOf-reuseRef/src/models/fruit.rs +++ b/samples/client/others/rust/reqwest/oneOf-reuseRef/src/models/fruit.rs @@ -16,8 +16,6 @@ use serde::{Deserialize, Serialize}; pub enum Fruit { #[serde(rename="green_apple")] GreenApple(Box), - #[serde(rename="red_apple")] - RedApple(Box), #[serde(rename="banana")] Banana(Box), } diff --git a/samples/client/petstore/rust/hyper/petstore/.openapi-generator/FILES b/samples/client/petstore/rust/hyper/petstore/.openapi-generator/FILES index 207b30d42fd0..d562641221d2 100644 --- a/samples/client/petstore/rust/hyper/petstore/.openapi-generator/FILES +++ b/samples/client/petstore/rust/hyper/petstore/.openapi-generator/FILES @@ -8,6 +8,7 @@ docs/ApiResponse.md docs/ArrayItemRefTest.md docs/Baz.md docs/Category.md +docs/DuplicateOneOf.md docs/DuplicateTest.md docs/Duplicatetest.md docs/EnumArrayTesting.md @@ -32,6 +33,8 @@ docs/UniqueItemArrayTesting.md docs/User.md docs/UserApi.md docs/Vehicle.md +docs/WithInnerOneOf.md +docs/WithInnerOneOfFoo.md git_push.sh src/apis/client.rs src/apis/configuration.rs @@ -50,6 +53,7 @@ src/models/api_response.rs src/models/array_item_ref_test.rs src/models/baz.rs src/models/category.rs +src/models/duplicate_one_of.rs src/models/duplicate_test.rs src/models/duplicatetest.rs src/models/enum_array_testing.rs @@ -69,3 +73,5 @@ src/models/type_testing.rs src/models/unique_item_array_testing.rs src/models/user.rs src/models/vehicle.rs +src/models/with_inner_one_of.rs +src/models/with_inner_one_of_foo.rs diff --git a/samples/client/petstore/rust/hyper/petstore/README.md b/samples/client/petstore/rust/hyper/petstore/README.md index cfd13021354f..854c07d03617 100644 --- a/samples/client/petstore/rust/hyper/petstore/README.md +++ b/samples/client/petstore/rust/hyper/petstore/README.md @@ -61,6 +61,7 @@ Class | Method | HTTP request | Description - [ArrayItemRefTest](docs/ArrayItemRefTest.md) - [Baz](docs/Baz.md) - [Category](docs/Category.md) + - [DuplicateOneOf](docs/DuplicateOneOf.md) - [DuplicateTest](docs/DuplicateTest.md) - [Duplicatetest](docs/Duplicatetest.md) - [EnumArrayTesting](docs/EnumArrayTesting.md) @@ -80,6 +81,8 @@ Class | Method | HTTP request | Description - [UniqueItemArrayTesting](docs/UniqueItemArrayTesting.md) - [User](docs/User.md) - [Vehicle](docs/Vehicle.md) + - [WithInnerOneOf](docs/WithInnerOneOf.md) + - [WithInnerOneOfFoo](docs/WithInnerOneOfFoo.md) To get access to the crate's generated documentation, use: diff --git a/samples/client/petstore/rust/hyper/petstore/docs/DuplicateOneOf.md b/samples/client/petstore/rust/hyper/petstore/docs/DuplicateOneOf.md new file mode 100644 index 000000000000..22b6b00f001b --- /dev/null +++ b/samples/client/petstore/rust/hyper/petstore/docs/DuplicateOneOf.md @@ -0,0 +1,11 @@ +# DuplicateOneOf + +## Enum Variants + +| Name | Description | +|---- | -----| +| Order | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/hyper/petstore/docs/WithInnerOneOf.md b/samples/client/petstore/rust/hyper/petstore/docs/WithInnerOneOf.md new file mode 100644 index 000000000000..5a91d39893fc --- /dev/null +++ b/samples/client/petstore/rust/hyper/petstore/docs/WithInnerOneOf.md @@ -0,0 +1,11 @@ +# WithInnerOneOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**foo** | Option<[**models::WithInnerOneOfFoo**](WithInnerOneOf_foo.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/hyper/petstore/docs/WithInnerOneOfFoo.md b/samples/client/petstore/rust/hyper/petstore/docs/WithInnerOneOfFoo.md new file mode 100644 index 000000000000..fcf524123aca --- /dev/null +++ b/samples/client/petstore/rust/hyper/petstore/docs/WithInnerOneOfFoo.md @@ -0,0 +1,11 @@ +# WithInnerOneOfFoo + +## Enum Variants + +| Name | Description | +|---- | -----| +| Order | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/duplicate_one_of.rs b/samples/client/petstore/rust/hyper/petstore/src/models/duplicate_one_of.rs new file mode 100644 index 000000000000..e1039b65bcf7 --- /dev/null +++ b/samples/client/petstore/rust/hyper/petstore/src/models/duplicate_one_of.rs @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DuplicateOneOf { + Order(Box), +} + +impl Default for DuplicateOneOf { + fn default() -> Self { + Self::Order(Default::default()) + } +} +/// Order Status +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "placed")] + Placed, + #[serde(rename = "approved")] + Approved, + #[serde(rename = "delivered")] + Delivered, +} + +impl Default for Status { + fn default() -> Status { + Self::Placed + } +} + diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/mod.rs b/samples/client/petstore/rust/hyper/petstore/src/models/mod.rs index aada8fbd0f5a..7a29904ca382 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/mod.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/mod.rs @@ -10,6 +10,8 @@ pub mod baz; pub use self::baz::Baz; pub mod category; pub use self::category::Category; +pub mod duplicate_one_of; +pub use self::duplicate_one_of::DuplicateOneOf; pub mod duplicate_test; pub use self::duplicate_test::DuplicateTest; pub mod duplicatetest; @@ -48,6 +50,10 @@ pub mod user; pub use self::user::User; pub mod vehicle; pub use self::vehicle::Vehicle; +pub mod with_inner_one_of; +pub use self::with_inner_one_of::WithInnerOneOf; +pub mod with_inner_one_of_foo; +pub use self::with_inner_one_of_foo::WithInnerOneOfFoo; use serde::{Deserialize, Deserializer, Serializer}; use serde_with::{de::DeserializeAsWrap, ser::SerializeAsWrap, DeserializeAs, SerializeAs}; use std::marker::PhantomData; diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/with_inner_one_of.rs b/samples/client/petstore/rust/hyper/petstore/src/models/with_inner_one_of.rs new file mode 100644 index 000000000000..625b96ba3e1c --- /dev/null +++ b/samples/client/petstore/rust/hyper/petstore/src/models/with_inner_one_of.rs @@ -0,0 +1,27 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct WithInnerOneOf { + #[serde(rename = "foo", skip_serializing_if = "Option::is_none")] + pub foo: Option>, +} + +impl WithInnerOneOf { + pub fn new() -> WithInnerOneOf { + WithInnerOneOf { + foo: None, + } + } +} + diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/with_inner_one_of_foo.rs b/samples/client/petstore/rust/hyper/petstore/src/models/with_inner_one_of_foo.rs new file mode 100644 index 000000000000..26ed4ce5f116 --- /dev/null +++ b/samples/client/petstore/rust/hyper/petstore/src/models/with_inner_one_of_foo.rs @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum WithInnerOneOfFoo { + Order(Box), +} + +impl Default for WithInnerOneOfFoo { + fn default() -> Self { + Self::Order(Default::default()) + } +} +/// Order Status +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "placed")] + Placed, + #[serde(rename = "approved")] + Approved, + #[serde(rename = "delivered")] + Delivered, +} + +impl Default for Status { + fn default() -> Status { + Self::Placed + } +} + diff --git a/samples/client/petstore/rust/hyper0x/petstore/.openapi-generator/FILES b/samples/client/petstore/rust/hyper0x/petstore/.openapi-generator/FILES index 917d2d668aa5..bbf905beda5c 100644 --- a/samples/client/petstore/rust/hyper0x/petstore/.openapi-generator/FILES +++ b/samples/client/petstore/rust/hyper0x/petstore/.openapi-generator/FILES @@ -8,6 +8,7 @@ docs/ApiResponse.md docs/ArrayItemRefTest.md docs/Baz.md docs/Category.md +docs/DuplicateOneOf.md docs/DuplicateTest.md docs/Duplicatetest.md docs/EnumArrayTesting.md @@ -32,6 +33,8 @@ docs/UniqueItemArrayTesting.md docs/User.md docs/UserApi.md docs/Vehicle.md +docs/WithInnerOneOf.md +docs/WithInnerOneOfFoo.md git_push.sh src/apis/configuration.rs src/apis/fake_api.rs @@ -48,6 +51,7 @@ src/models/api_response.rs src/models/array_item_ref_test.rs src/models/baz.rs src/models/category.rs +src/models/duplicate_one_of.rs src/models/duplicate_test.rs src/models/duplicatetest.rs src/models/enum_array_testing.rs @@ -67,3 +71,5 @@ src/models/type_testing.rs src/models/unique_item_array_testing.rs src/models/user.rs src/models/vehicle.rs +src/models/with_inner_one_of.rs +src/models/with_inner_one_of_foo.rs diff --git a/samples/client/petstore/rust/hyper0x/petstore/README.md b/samples/client/petstore/rust/hyper0x/petstore/README.md index 004e40b277c5..cde988eb1510 100644 --- a/samples/client/petstore/rust/hyper0x/petstore/README.md +++ b/samples/client/petstore/rust/hyper0x/petstore/README.md @@ -61,6 +61,7 @@ Class | Method | HTTP request | Description - [ArrayItemRefTest](docs/ArrayItemRefTest.md) - [Baz](docs/Baz.md) - [Category](docs/Category.md) + - [DuplicateOneOf](docs/DuplicateOneOf.md) - [DuplicateTest](docs/DuplicateTest.md) - [Duplicatetest](docs/Duplicatetest.md) - [EnumArrayTesting](docs/EnumArrayTesting.md) @@ -80,6 +81,8 @@ Class | Method | HTTP request | Description - [UniqueItemArrayTesting](docs/UniqueItemArrayTesting.md) - [User](docs/User.md) - [Vehicle](docs/Vehicle.md) + - [WithInnerOneOf](docs/WithInnerOneOf.md) + - [WithInnerOneOfFoo](docs/WithInnerOneOfFoo.md) To get access to the crate's generated documentation, use: diff --git a/samples/client/petstore/rust/hyper0x/petstore/docs/DuplicateOneOf.md b/samples/client/petstore/rust/hyper0x/petstore/docs/DuplicateOneOf.md new file mode 100644 index 000000000000..22b6b00f001b --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/docs/DuplicateOneOf.md @@ -0,0 +1,11 @@ +# DuplicateOneOf + +## Enum Variants + +| Name | Description | +|---- | -----| +| Order | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/hyper0x/petstore/docs/WithInnerOneOf.md b/samples/client/petstore/rust/hyper0x/petstore/docs/WithInnerOneOf.md new file mode 100644 index 000000000000..5a91d39893fc --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/docs/WithInnerOneOf.md @@ -0,0 +1,11 @@ +# WithInnerOneOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**foo** | Option<[**models::WithInnerOneOfFoo**](WithInnerOneOf_foo.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/hyper0x/petstore/docs/WithInnerOneOfFoo.md b/samples/client/petstore/rust/hyper0x/petstore/docs/WithInnerOneOfFoo.md new file mode 100644 index 000000000000..fcf524123aca --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/docs/WithInnerOneOfFoo.md @@ -0,0 +1,11 @@ +# WithInnerOneOfFoo + +## Enum Variants + +| Name | Description | +|---- | -----| +| Order | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/hyper0x/petstore/src/models/duplicate_one_of.rs b/samples/client/petstore/rust/hyper0x/petstore/src/models/duplicate_one_of.rs new file mode 100644 index 000000000000..e1039b65bcf7 --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/src/models/duplicate_one_of.rs @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DuplicateOneOf { + Order(Box), +} + +impl Default for DuplicateOneOf { + fn default() -> Self { + Self::Order(Default::default()) + } +} +/// Order Status +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "placed")] + Placed, + #[serde(rename = "approved")] + Approved, + #[serde(rename = "delivered")] + Delivered, +} + +impl Default for Status { + fn default() -> Status { + Self::Placed + } +} + diff --git a/samples/client/petstore/rust/hyper0x/petstore/src/models/mod.rs b/samples/client/petstore/rust/hyper0x/petstore/src/models/mod.rs index aada8fbd0f5a..7a29904ca382 100644 --- a/samples/client/petstore/rust/hyper0x/petstore/src/models/mod.rs +++ b/samples/client/petstore/rust/hyper0x/petstore/src/models/mod.rs @@ -10,6 +10,8 @@ pub mod baz; pub use self::baz::Baz; pub mod category; pub use self::category::Category; +pub mod duplicate_one_of; +pub use self::duplicate_one_of::DuplicateOneOf; pub mod duplicate_test; pub use self::duplicate_test::DuplicateTest; pub mod duplicatetest; @@ -48,6 +50,10 @@ pub mod user; pub use self::user::User; pub mod vehicle; pub use self::vehicle::Vehicle; +pub mod with_inner_one_of; +pub use self::with_inner_one_of::WithInnerOneOf; +pub mod with_inner_one_of_foo; +pub use self::with_inner_one_of_foo::WithInnerOneOfFoo; use serde::{Deserialize, Deserializer, Serializer}; use serde_with::{de::DeserializeAsWrap, ser::SerializeAsWrap, DeserializeAs, SerializeAs}; use std::marker::PhantomData; diff --git a/samples/client/petstore/rust/hyper0x/petstore/src/models/with_inner_one_of.rs b/samples/client/petstore/rust/hyper0x/petstore/src/models/with_inner_one_of.rs new file mode 100644 index 000000000000..625b96ba3e1c --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/src/models/with_inner_one_of.rs @@ -0,0 +1,27 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct WithInnerOneOf { + #[serde(rename = "foo", skip_serializing_if = "Option::is_none")] + pub foo: Option>, +} + +impl WithInnerOneOf { + pub fn new() -> WithInnerOneOf { + WithInnerOneOf { + foo: None, + } + } +} + diff --git a/samples/client/petstore/rust/hyper0x/petstore/src/models/with_inner_one_of_foo.rs b/samples/client/petstore/rust/hyper0x/petstore/src/models/with_inner_one_of_foo.rs new file mode 100644 index 000000000000..26ed4ce5f116 --- /dev/null +++ b/samples/client/petstore/rust/hyper0x/petstore/src/models/with_inner_one_of_foo.rs @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum WithInnerOneOfFoo { + Order(Box), +} + +impl Default for WithInnerOneOfFoo { + fn default() -> Self { + Self::Order(Default::default()) + } +} +/// Order Status +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "placed")] + Placed, + #[serde(rename = "approved")] + Approved, + #[serde(rename = "delivered")] + Delivered, +} + +impl Default for Status { + fn default() -> Status { + Self::Placed + } +} + diff --git a/samples/client/petstore/rust/reqwest-trait/petstore/.openapi-generator/FILES b/samples/client/petstore/rust/reqwest-trait/petstore/.openapi-generator/FILES index 917d2d668aa5..bbf905beda5c 100644 --- a/samples/client/petstore/rust/reqwest-trait/petstore/.openapi-generator/FILES +++ b/samples/client/petstore/rust/reqwest-trait/petstore/.openapi-generator/FILES @@ -8,6 +8,7 @@ docs/ApiResponse.md docs/ArrayItemRefTest.md docs/Baz.md docs/Category.md +docs/DuplicateOneOf.md docs/DuplicateTest.md docs/Duplicatetest.md docs/EnumArrayTesting.md @@ -32,6 +33,8 @@ docs/UniqueItemArrayTesting.md docs/User.md docs/UserApi.md docs/Vehicle.md +docs/WithInnerOneOf.md +docs/WithInnerOneOfFoo.md git_push.sh src/apis/configuration.rs src/apis/fake_api.rs @@ -48,6 +51,7 @@ src/models/api_response.rs src/models/array_item_ref_test.rs src/models/baz.rs src/models/category.rs +src/models/duplicate_one_of.rs src/models/duplicate_test.rs src/models/duplicatetest.rs src/models/enum_array_testing.rs @@ -67,3 +71,5 @@ src/models/type_testing.rs src/models/unique_item_array_testing.rs src/models/user.rs src/models/vehicle.rs +src/models/with_inner_one_of.rs +src/models/with_inner_one_of_foo.rs diff --git a/samples/client/petstore/rust/reqwest-trait/petstore/README.md b/samples/client/petstore/rust/reqwest-trait/petstore/README.md index d0e487fa6291..799a40b51908 100644 --- a/samples/client/petstore/rust/reqwest-trait/petstore/README.md +++ b/samples/client/petstore/rust/reqwest-trait/petstore/README.md @@ -61,6 +61,7 @@ Class | Method | HTTP request | Description - [ArrayItemRefTest](docs/ArrayItemRefTest.md) - [Baz](docs/Baz.md) - [Category](docs/Category.md) + - [DuplicateOneOf](docs/DuplicateOneOf.md) - [DuplicateTest](docs/DuplicateTest.md) - [Duplicatetest](docs/Duplicatetest.md) - [EnumArrayTesting](docs/EnumArrayTesting.md) @@ -80,6 +81,8 @@ Class | Method | HTTP request | Description - [UniqueItemArrayTesting](docs/UniqueItemArrayTesting.md) - [User](docs/User.md) - [Vehicle](docs/Vehicle.md) + - [WithInnerOneOf](docs/WithInnerOneOf.md) + - [WithInnerOneOfFoo](docs/WithInnerOneOfFoo.md) To get access to the crate's generated documentation, use: diff --git a/samples/client/petstore/rust/reqwest-trait/petstore/docs/DuplicateOneOf.md b/samples/client/petstore/rust/reqwest-trait/petstore/docs/DuplicateOneOf.md new file mode 100644 index 000000000000..22b6b00f001b --- /dev/null +++ b/samples/client/petstore/rust/reqwest-trait/petstore/docs/DuplicateOneOf.md @@ -0,0 +1,11 @@ +# DuplicateOneOf + +## Enum Variants + +| Name | Description | +|---- | -----| +| Order | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/reqwest-trait/petstore/docs/WithInnerOneOf.md b/samples/client/petstore/rust/reqwest-trait/petstore/docs/WithInnerOneOf.md new file mode 100644 index 000000000000..5a91d39893fc --- /dev/null +++ b/samples/client/petstore/rust/reqwest-trait/petstore/docs/WithInnerOneOf.md @@ -0,0 +1,11 @@ +# WithInnerOneOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**foo** | Option<[**models::WithInnerOneOfFoo**](WithInnerOneOf_foo.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/reqwest-trait/petstore/docs/WithInnerOneOfFoo.md b/samples/client/petstore/rust/reqwest-trait/petstore/docs/WithInnerOneOfFoo.md new file mode 100644 index 000000000000..fcf524123aca --- /dev/null +++ b/samples/client/petstore/rust/reqwest-trait/petstore/docs/WithInnerOneOfFoo.md @@ -0,0 +1,11 @@ +# WithInnerOneOfFoo + +## Enum Variants + +| Name | Description | +|---- | -----| +| Order | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/reqwest-trait/petstore/src/models/duplicate_one_of.rs b/samples/client/petstore/rust/reqwest-trait/petstore/src/models/duplicate_one_of.rs new file mode 100644 index 000000000000..ad47a777daec --- /dev/null +++ b/samples/client/petstore/rust/reqwest-trait/petstore/src/models/duplicate_one_of.rs @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DuplicateOneOf { + Order(Box), +} + +impl Default for DuplicateOneOf { + fn default() -> Self { + Self::Order(Default::default()) + } +} +/// Order Status +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "placed")] + Placed, + #[serde(rename = "approved")] + Approved, + #[serde(rename = "delivered")] + shipped, +} + +impl Default for Status { + fn default() -> Status { + Self::Placed + } +} + diff --git a/samples/client/petstore/rust/reqwest-trait/petstore/src/models/mod.rs b/samples/client/petstore/rust/reqwest-trait/petstore/src/models/mod.rs index aada8fbd0f5a..7a29904ca382 100644 --- a/samples/client/petstore/rust/reqwest-trait/petstore/src/models/mod.rs +++ b/samples/client/petstore/rust/reqwest-trait/petstore/src/models/mod.rs @@ -10,6 +10,8 @@ pub mod baz; pub use self::baz::Baz; pub mod category; pub use self::category::Category; +pub mod duplicate_one_of; +pub use self::duplicate_one_of::DuplicateOneOf; pub mod duplicate_test; pub use self::duplicate_test::DuplicateTest; pub mod duplicatetest; @@ -48,6 +50,10 @@ pub mod user; pub use self::user::User; pub mod vehicle; pub use self::vehicle::Vehicle; +pub mod with_inner_one_of; +pub use self::with_inner_one_of::WithInnerOneOf; +pub mod with_inner_one_of_foo; +pub use self::with_inner_one_of_foo::WithInnerOneOfFoo; use serde::{Deserialize, Deserializer, Serializer}; use serde_with::{de::DeserializeAsWrap, ser::SerializeAsWrap, DeserializeAs, SerializeAs}; use std::marker::PhantomData; diff --git a/samples/client/petstore/rust/reqwest-trait/petstore/src/models/with_inner_one_of.rs b/samples/client/petstore/rust/reqwest-trait/petstore/src/models/with_inner_one_of.rs new file mode 100644 index 000000000000..625b96ba3e1c --- /dev/null +++ b/samples/client/petstore/rust/reqwest-trait/petstore/src/models/with_inner_one_of.rs @@ -0,0 +1,27 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct WithInnerOneOf { + #[serde(rename = "foo", skip_serializing_if = "Option::is_none")] + pub foo: Option>, +} + +impl WithInnerOneOf { + pub fn new() -> WithInnerOneOf { + WithInnerOneOf { + foo: None, + } + } +} + diff --git a/samples/client/petstore/rust/reqwest-trait/petstore/src/models/with_inner_one_of_foo.rs b/samples/client/petstore/rust/reqwest-trait/petstore/src/models/with_inner_one_of_foo.rs new file mode 100644 index 000000000000..9917806aa62b --- /dev/null +++ b/samples/client/petstore/rust/reqwest-trait/petstore/src/models/with_inner_one_of_foo.rs @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum WithInnerOneOfFoo { + Order(Box), +} + +impl Default for WithInnerOneOfFoo { + fn default() -> Self { + Self::Order(Default::default()) + } +} +/// Order Status +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "placed")] + Placed, + #[serde(rename = "approved")] + Approved, + #[serde(rename = "delivered")] + shipped, +} + +impl Default for Status { + fn default() -> Status { + Self::Placed + } +} + diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/.openapi-generator/FILES b/samples/client/petstore/rust/reqwest/petstore-async-middleware/.openapi-generator/FILES index 917d2d668aa5..bbf905beda5c 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/.openapi-generator/FILES +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/.openapi-generator/FILES @@ -8,6 +8,7 @@ docs/ApiResponse.md docs/ArrayItemRefTest.md docs/Baz.md docs/Category.md +docs/DuplicateOneOf.md docs/DuplicateTest.md docs/Duplicatetest.md docs/EnumArrayTesting.md @@ -32,6 +33,8 @@ docs/UniqueItemArrayTesting.md docs/User.md docs/UserApi.md docs/Vehicle.md +docs/WithInnerOneOf.md +docs/WithInnerOneOfFoo.md git_push.sh src/apis/configuration.rs src/apis/fake_api.rs @@ -48,6 +51,7 @@ src/models/api_response.rs src/models/array_item_ref_test.rs src/models/baz.rs src/models/category.rs +src/models/duplicate_one_of.rs src/models/duplicate_test.rs src/models/duplicatetest.rs src/models/enum_array_testing.rs @@ -67,3 +71,5 @@ src/models/type_testing.rs src/models/unique_item_array_testing.rs src/models/user.rs src/models/vehicle.rs +src/models/with_inner_one_of.rs +src/models/with_inner_one_of_foo.rs 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 ff02477fd89f..7e05aa0991cc 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/README.md +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/README.md @@ -61,6 +61,7 @@ Class | Method | HTTP request | Description - [ArrayItemRefTest](docs/ArrayItemRefTest.md) - [Baz](docs/Baz.md) - [Category](docs/Category.md) + - [DuplicateOneOf](docs/DuplicateOneOf.md) - [DuplicateTest](docs/DuplicateTest.md) - [Duplicatetest](docs/Duplicatetest.md) - [EnumArrayTesting](docs/EnumArrayTesting.md) @@ -80,6 +81,8 @@ Class | Method | HTTP request | Description - [UniqueItemArrayTesting](docs/UniqueItemArrayTesting.md) - [User](docs/User.md) - [Vehicle](docs/Vehicle.md) + - [WithInnerOneOf](docs/WithInnerOneOf.md) + - [WithInnerOneOfFoo](docs/WithInnerOneOfFoo.md) To get access to the crate's generated documentation, use: diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/DuplicateOneOf.md b/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/DuplicateOneOf.md new file mode 100644 index 000000000000..22b6b00f001b --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/DuplicateOneOf.md @@ -0,0 +1,11 @@ +# DuplicateOneOf + +## Enum Variants + +| Name | Description | +|---- | -----| +| Order | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/WithInnerOneOf.md b/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/WithInnerOneOf.md new file mode 100644 index 000000000000..5a91d39893fc --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/WithInnerOneOf.md @@ -0,0 +1,11 @@ +# WithInnerOneOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**foo** | Option<[**models::WithInnerOneOfFoo**](WithInnerOneOf_foo.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/WithInnerOneOfFoo.md b/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/WithInnerOneOfFoo.md new file mode 100644 index 000000000000..fcf524123aca --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/WithInnerOneOfFoo.md @@ -0,0 +1,11 @@ +# WithInnerOneOfFoo + +## Enum Variants + +| Name | Description | +|---- | -----| +| Order | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/duplicate_one_of.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/duplicate_one_of.rs new file mode 100644 index 000000000000..e1039b65bcf7 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/duplicate_one_of.rs @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DuplicateOneOf { + Order(Box), +} + +impl Default for DuplicateOneOf { + fn default() -> Self { + Self::Order(Default::default()) + } +} +/// Order Status +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "placed")] + Placed, + #[serde(rename = "approved")] + Approved, + #[serde(rename = "delivered")] + Delivered, +} + +impl Default for Status { + fn default() -> Status { + Self::Placed + } +} + diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/mod.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/mod.rs index aada8fbd0f5a..7a29904ca382 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/mod.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/mod.rs @@ -10,6 +10,8 @@ pub mod baz; pub use self::baz::Baz; pub mod category; pub use self::category::Category; +pub mod duplicate_one_of; +pub use self::duplicate_one_of::DuplicateOneOf; pub mod duplicate_test; pub use self::duplicate_test::DuplicateTest; pub mod duplicatetest; @@ -48,6 +50,10 @@ pub mod user; pub use self::user::User; pub mod vehicle; pub use self::vehicle::Vehicle; +pub mod with_inner_one_of; +pub use self::with_inner_one_of::WithInnerOneOf; +pub mod with_inner_one_of_foo; +pub use self::with_inner_one_of_foo::WithInnerOneOfFoo; use serde::{Deserialize, Deserializer, Serializer}; use serde_with::{de::DeserializeAsWrap, ser::SerializeAsWrap, DeserializeAs, SerializeAs}; use std::marker::PhantomData; diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/with_inner_one_of.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/with_inner_one_of.rs new file mode 100644 index 000000000000..625b96ba3e1c --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/with_inner_one_of.rs @@ -0,0 +1,27 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct WithInnerOneOf { + #[serde(rename = "foo", skip_serializing_if = "Option::is_none")] + pub foo: Option>, +} + +impl WithInnerOneOf { + pub fn new() -> WithInnerOneOf { + WithInnerOneOf { + foo: None, + } + } +} + diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/with_inner_one_of_foo.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/with_inner_one_of_foo.rs new file mode 100644 index 000000000000..26ed4ce5f116 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/with_inner_one_of_foo.rs @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum WithInnerOneOfFoo { + Order(Box), +} + +impl Default for WithInnerOneOfFoo { + fn default() -> Self { + Self::Order(Default::default()) + } +} +/// Order Status +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "placed")] + Placed, + #[serde(rename = "approved")] + Approved, + #[serde(rename = "delivered")] + Delivered, +} + +impl Default for Status { + fn default() -> Status { + Self::Placed + } +} + diff --git a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/.openapi-generator/FILES b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/.openapi-generator/FILES index 917d2d668aa5..bbf905beda5c 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/.openapi-generator/FILES +++ b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/.openapi-generator/FILES @@ -8,6 +8,7 @@ docs/ApiResponse.md docs/ArrayItemRefTest.md docs/Baz.md docs/Category.md +docs/DuplicateOneOf.md docs/DuplicateTest.md docs/Duplicatetest.md docs/EnumArrayTesting.md @@ -32,6 +33,8 @@ docs/UniqueItemArrayTesting.md docs/User.md docs/UserApi.md docs/Vehicle.md +docs/WithInnerOneOf.md +docs/WithInnerOneOfFoo.md git_push.sh src/apis/configuration.rs src/apis/fake_api.rs @@ -48,6 +51,7 @@ src/models/api_response.rs src/models/array_item_ref_test.rs src/models/baz.rs src/models/category.rs +src/models/duplicate_one_of.rs src/models/duplicate_test.rs src/models/duplicatetest.rs src/models/enum_array_testing.rs @@ -67,3 +71,5 @@ src/models/type_testing.rs src/models/unique_item_array_testing.rs src/models/user.rs src/models/vehicle.rs +src/models/with_inner_one_of.rs +src/models/with_inner_one_of_foo.rs 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 f9a3f3064a92..72f2f4c77cd2 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/README.md +++ b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/README.md @@ -61,6 +61,7 @@ Class | Method | HTTP request | Description - [ArrayItemRefTest](docs/ArrayItemRefTest.md) - [Baz](docs/Baz.md) - [Category](docs/Category.md) + - [DuplicateOneOf](docs/DuplicateOneOf.md) - [DuplicateTest](docs/DuplicateTest.md) - [Duplicatetest](docs/Duplicatetest.md) - [EnumArrayTesting](docs/EnumArrayTesting.md) @@ -80,6 +81,8 @@ Class | Method | HTTP request | Description - [UniqueItemArrayTesting](docs/UniqueItemArrayTesting.md) - [User](docs/User.md) - [Vehicle](docs/Vehicle.md) + - [WithInnerOneOf](docs/WithInnerOneOf.md) + - [WithInnerOneOfFoo](docs/WithInnerOneOfFoo.md) To get access to the crate's generated documentation, use: diff --git a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/DuplicateOneOf.md b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/DuplicateOneOf.md new file mode 100644 index 000000000000..22b6b00f001b --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/DuplicateOneOf.md @@ -0,0 +1,11 @@ +# DuplicateOneOf + +## Enum Variants + +| Name | Description | +|---- | -----| +| Order | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/WithInnerOneOf.md b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/WithInnerOneOf.md new file mode 100644 index 000000000000..5a91d39893fc --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/WithInnerOneOf.md @@ -0,0 +1,11 @@ +# WithInnerOneOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**foo** | Option<[**models::WithInnerOneOfFoo**](WithInnerOneOf_foo.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/WithInnerOneOfFoo.md b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/WithInnerOneOfFoo.md new file mode 100644 index 000000000000..fcf524123aca --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/WithInnerOneOfFoo.md @@ -0,0 +1,11 @@ +# WithInnerOneOfFoo + +## Enum Variants + +| Name | Description | +|---- | -----| +| Order | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/duplicate_one_of.rs b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/duplicate_one_of.rs new file mode 100644 index 000000000000..e1039b65bcf7 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/duplicate_one_of.rs @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DuplicateOneOf { + Order(Box), +} + +impl Default for DuplicateOneOf { + fn default() -> Self { + Self::Order(Default::default()) + } +} +/// Order Status +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "placed")] + Placed, + #[serde(rename = "approved")] + Approved, + #[serde(rename = "delivered")] + Delivered, +} + +impl Default for Status { + fn default() -> Status { + Self::Placed + } +} + diff --git a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/mod.rs b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/mod.rs index aada8fbd0f5a..7a29904ca382 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/mod.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/mod.rs @@ -10,6 +10,8 @@ pub mod baz; pub use self::baz::Baz; pub mod category; pub use self::category::Category; +pub mod duplicate_one_of; +pub use self::duplicate_one_of::DuplicateOneOf; pub mod duplicate_test; pub use self::duplicate_test::DuplicateTest; pub mod duplicatetest; @@ -48,6 +50,10 @@ pub mod user; pub use self::user::User; pub mod vehicle; pub use self::vehicle::Vehicle; +pub mod with_inner_one_of; +pub use self::with_inner_one_of::WithInnerOneOf; +pub mod with_inner_one_of_foo; +pub use self::with_inner_one_of_foo::WithInnerOneOfFoo; use serde::{Deserialize, Deserializer, Serializer}; use serde_with::{de::DeserializeAsWrap, ser::SerializeAsWrap, DeserializeAs, SerializeAs}; use std::marker::PhantomData; diff --git a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/with_inner_one_of.rs b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/with_inner_one_of.rs new file mode 100644 index 000000000000..625b96ba3e1c --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/with_inner_one_of.rs @@ -0,0 +1,27 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct WithInnerOneOf { + #[serde(rename = "foo", skip_serializing_if = "Option::is_none")] + pub foo: Option>, +} + +impl WithInnerOneOf { + pub fn new() -> WithInnerOneOf { + WithInnerOneOf { + foo: None, + } + } +} + diff --git a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/with_inner_one_of_foo.rs b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/with_inner_one_of_foo.rs new file mode 100644 index 000000000000..26ed4ce5f116 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/with_inner_one_of_foo.rs @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum WithInnerOneOfFoo { + Order(Box), +} + +impl Default for WithInnerOneOfFoo { + fn default() -> Self { + Self::Order(Default::default()) + } +} +/// Order Status +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "placed")] + Placed, + #[serde(rename = "approved")] + Approved, + #[serde(rename = "delivered")] + Delivered, +} + +impl Default for Status { + fn default() -> Status { + Self::Placed + } +} + diff --git a/samples/client/petstore/rust/reqwest/petstore-async/.openapi-generator/FILES b/samples/client/petstore/rust/reqwest/petstore-async/.openapi-generator/FILES index 917d2d668aa5..bbf905beda5c 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/.openapi-generator/FILES +++ b/samples/client/petstore/rust/reqwest/petstore-async/.openapi-generator/FILES @@ -8,6 +8,7 @@ docs/ApiResponse.md docs/ArrayItemRefTest.md docs/Baz.md docs/Category.md +docs/DuplicateOneOf.md docs/DuplicateTest.md docs/Duplicatetest.md docs/EnumArrayTesting.md @@ -32,6 +33,8 @@ docs/UniqueItemArrayTesting.md docs/User.md docs/UserApi.md docs/Vehicle.md +docs/WithInnerOneOf.md +docs/WithInnerOneOfFoo.md git_push.sh src/apis/configuration.rs src/apis/fake_api.rs @@ -48,6 +51,7 @@ src/models/api_response.rs src/models/array_item_ref_test.rs src/models/baz.rs src/models/category.rs +src/models/duplicate_one_of.rs src/models/duplicate_test.rs src/models/duplicatetest.rs src/models/enum_array_testing.rs @@ -67,3 +71,5 @@ src/models/type_testing.rs src/models/unique_item_array_testing.rs src/models/user.rs src/models/vehicle.rs +src/models/with_inner_one_of.rs +src/models/with_inner_one_of_foo.rs diff --git a/samples/client/petstore/rust/reqwest/petstore-async/README.md b/samples/client/petstore/rust/reqwest/petstore-async/README.md index 1b9b248b3b10..d389686ce166 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/README.md +++ b/samples/client/petstore/rust/reqwest/petstore-async/README.md @@ -61,6 +61,7 @@ Class | Method | HTTP request | Description - [ArrayItemRefTest](docs/ArrayItemRefTest.md) - [Baz](docs/Baz.md) - [Category](docs/Category.md) + - [DuplicateOneOf](docs/DuplicateOneOf.md) - [DuplicateTest](docs/DuplicateTest.md) - [Duplicatetest](docs/Duplicatetest.md) - [EnumArrayTesting](docs/EnumArrayTesting.md) @@ -80,6 +81,8 @@ Class | Method | HTTP request | Description - [UniqueItemArrayTesting](docs/UniqueItemArrayTesting.md) - [User](docs/User.md) - [Vehicle](docs/Vehicle.md) + - [WithInnerOneOf](docs/WithInnerOneOf.md) + - [WithInnerOneOfFoo](docs/WithInnerOneOfFoo.md) To get access to the crate's generated documentation, use: diff --git a/samples/client/petstore/rust/reqwest/petstore-async/docs/DuplicateOneOf.md b/samples/client/petstore/rust/reqwest/petstore-async/docs/DuplicateOneOf.md new file mode 100644 index 000000000000..22b6b00f001b --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-async/docs/DuplicateOneOf.md @@ -0,0 +1,11 @@ +# DuplicateOneOf + +## Enum Variants + +| Name | Description | +|---- | -----| +| Order | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/reqwest/petstore-async/docs/WithInnerOneOf.md b/samples/client/petstore/rust/reqwest/petstore-async/docs/WithInnerOneOf.md new file mode 100644 index 000000000000..5a91d39893fc --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-async/docs/WithInnerOneOf.md @@ -0,0 +1,11 @@ +# WithInnerOneOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**foo** | Option<[**models::WithInnerOneOfFoo**](WithInnerOneOf_foo.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/reqwest/petstore-async/docs/WithInnerOneOfFoo.md b/samples/client/petstore/rust/reqwest/petstore-async/docs/WithInnerOneOfFoo.md new file mode 100644 index 000000000000..fcf524123aca --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-async/docs/WithInnerOneOfFoo.md @@ -0,0 +1,11 @@ +# WithInnerOneOfFoo + +## Enum Variants + +| Name | Description | +|---- | -----| +| Order | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/duplicate_one_of.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/duplicate_one_of.rs new file mode 100644 index 000000000000..e1039b65bcf7 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/duplicate_one_of.rs @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DuplicateOneOf { + Order(Box), +} + +impl Default for DuplicateOneOf { + fn default() -> Self { + Self::Order(Default::default()) + } +} +/// Order Status +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "placed")] + Placed, + #[serde(rename = "approved")] + Approved, + #[serde(rename = "delivered")] + Delivered, +} + +impl Default for Status { + fn default() -> Status { + Self::Placed + } +} + diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/mod.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/mod.rs index aada8fbd0f5a..7a29904ca382 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/mod.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/mod.rs @@ -10,6 +10,8 @@ pub mod baz; pub use self::baz::Baz; pub mod category; pub use self::category::Category; +pub mod duplicate_one_of; +pub use self::duplicate_one_of::DuplicateOneOf; pub mod duplicate_test; pub use self::duplicate_test::DuplicateTest; pub mod duplicatetest; @@ -48,6 +50,10 @@ pub mod user; pub use self::user::User; pub mod vehicle; pub use self::vehicle::Vehicle; +pub mod with_inner_one_of; +pub use self::with_inner_one_of::WithInnerOneOf; +pub mod with_inner_one_of_foo; +pub use self::with_inner_one_of_foo::WithInnerOneOfFoo; use serde::{Deserialize, Deserializer, Serializer}; use serde_with::{de::DeserializeAsWrap, ser::SerializeAsWrap, DeserializeAs, SerializeAs}; use std::marker::PhantomData; diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/with_inner_one_of.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/with_inner_one_of.rs new file mode 100644 index 000000000000..625b96ba3e1c --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/with_inner_one_of.rs @@ -0,0 +1,27 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct WithInnerOneOf { + #[serde(rename = "foo", skip_serializing_if = "Option::is_none")] + pub foo: Option>, +} + +impl WithInnerOneOf { + pub fn new() -> WithInnerOneOf { + WithInnerOneOf { + foo: None, + } + } +} + diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/with_inner_one_of_foo.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/with_inner_one_of_foo.rs new file mode 100644 index 000000000000..26ed4ce5f116 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/with_inner_one_of_foo.rs @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum WithInnerOneOfFoo { + Order(Box), +} + +impl Default for WithInnerOneOfFoo { + fn default() -> Self { + Self::Order(Default::default()) + } +} +/// Order Status +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "placed")] + Placed, + #[serde(rename = "approved")] + Approved, + #[serde(rename = "delivered")] + Delivered, +} + +impl Default for Status { + fn default() -> Status { + Self::Placed + } +} + diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/.openapi-generator/FILES b/samples/client/petstore/rust/reqwest/petstore-avoid-box/.openapi-generator/FILES index 917d2d668aa5..bbf905beda5c 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/.openapi-generator/FILES +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/.openapi-generator/FILES @@ -8,6 +8,7 @@ docs/ApiResponse.md docs/ArrayItemRefTest.md docs/Baz.md docs/Category.md +docs/DuplicateOneOf.md docs/DuplicateTest.md docs/Duplicatetest.md docs/EnumArrayTesting.md @@ -32,6 +33,8 @@ docs/UniqueItemArrayTesting.md docs/User.md docs/UserApi.md docs/Vehicle.md +docs/WithInnerOneOf.md +docs/WithInnerOneOfFoo.md git_push.sh src/apis/configuration.rs src/apis/fake_api.rs @@ -48,6 +51,7 @@ src/models/api_response.rs src/models/array_item_ref_test.rs src/models/baz.rs src/models/category.rs +src/models/duplicate_one_of.rs src/models/duplicate_test.rs src/models/duplicatetest.rs src/models/enum_array_testing.rs @@ -67,3 +71,5 @@ src/models/type_testing.rs src/models/unique_item_array_testing.rs src/models/user.rs src/models/vehicle.rs +src/models/with_inner_one_of.rs +src/models/with_inner_one_of_foo.rs 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 ccd59027dd2e..3225fb11001f 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/README.md +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/README.md @@ -61,6 +61,7 @@ Class | Method | HTTP request | Description - [ArrayItemRefTest](docs/ArrayItemRefTest.md) - [Baz](docs/Baz.md) - [Category](docs/Category.md) + - [DuplicateOneOf](docs/DuplicateOneOf.md) - [DuplicateTest](docs/DuplicateTest.md) - [Duplicatetest](docs/Duplicatetest.md) - [EnumArrayTesting](docs/EnumArrayTesting.md) @@ -80,6 +81,8 @@ Class | Method | HTTP request | Description - [UniqueItemArrayTesting](docs/UniqueItemArrayTesting.md) - [User](docs/User.md) - [Vehicle](docs/Vehicle.md) + - [WithInnerOneOf](docs/WithInnerOneOf.md) + - [WithInnerOneOfFoo](docs/WithInnerOneOfFoo.md) To get access to the crate's generated documentation, use: diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/DuplicateOneOf.md b/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/DuplicateOneOf.md new file mode 100644 index 000000000000..22b6b00f001b --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/DuplicateOneOf.md @@ -0,0 +1,11 @@ +# DuplicateOneOf + +## Enum Variants + +| Name | Description | +|---- | -----| +| Order | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/WithInnerOneOf.md b/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/WithInnerOneOf.md new file mode 100644 index 000000000000..5a91d39893fc --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/WithInnerOneOf.md @@ -0,0 +1,11 @@ +# WithInnerOneOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**foo** | Option<[**models::WithInnerOneOfFoo**](WithInnerOneOf_foo.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/WithInnerOneOfFoo.md b/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/WithInnerOneOfFoo.md new file mode 100644 index 000000000000..fcf524123aca --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/WithInnerOneOfFoo.md @@ -0,0 +1,11 @@ +# WithInnerOneOfFoo + +## Enum Variants + +| Name | Description | +|---- | -----| +| Order | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/duplicate_one_of.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/duplicate_one_of.rs new file mode 100644 index 000000000000..383d72228121 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/duplicate_one_of.rs @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DuplicateOneOf { + Order(models::Order), +} + +impl Default for DuplicateOneOf { + fn default() -> Self { + Self::Order(Default::default()) + } +} +/// Order Status +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "placed")] + Placed, + #[serde(rename = "approved")] + Approved, + #[serde(rename = "delivered")] + Delivered, +} + +impl Default for Status { + fn default() -> Status { + Self::Placed + } +} + diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/mod.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/mod.rs index aada8fbd0f5a..7a29904ca382 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/mod.rs +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/mod.rs @@ -10,6 +10,8 @@ pub mod baz; pub use self::baz::Baz; pub mod category; pub use self::category::Category; +pub mod duplicate_one_of; +pub use self::duplicate_one_of::DuplicateOneOf; pub mod duplicate_test; pub use self::duplicate_test::DuplicateTest; pub mod duplicatetest; @@ -48,6 +50,10 @@ pub mod user; pub use self::user::User; pub mod vehicle; pub use self::vehicle::Vehicle; +pub mod with_inner_one_of; +pub use self::with_inner_one_of::WithInnerOneOf; +pub mod with_inner_one_of_foo; +pub use self::with_inner_one_of_foo::WithInnerOneOfFoo; use serde::{Deserialize, Deserializer, Serializer}; use serde_with::{de::DeserializeAsWrap, ser::SerializeAsWrap, DeserializeAs, SerializeAs}; use std::marker::PhantomData; diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/with_inner_one_of.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/with_inner_one_of.rs new file mode 100644 index 000000000000..7afd59a1473a --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/with_inner_one_of.rs @@ -0,0 +1,27 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct WithInnerOneOf { + #[serde(rename = "foo", skip_serializing_if = "Option::is_none")] + pub foo: Option, +} + +impl WithInnerOneOf { + pub fn new() -> WithInnerOneOf { + WithInnerOneOf { + foo: None, + } + } +} + diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/with_inner_one_of_foo.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/with_inner_one_of_foo.rs new file mode 100644 index 000000000000..a0263960c69b --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/with_inner_one_of_foo.rs @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum WithInnerOneOfFoo { + Order(models::Order), +} + +impl Default for WithInnerOneOfFoo { + fn default() -> Self { + Self::Order(Default::default()) + } +} +/// Order Status +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "placed")] + Placed, + #[serde(rename = "approved")] + Approved, + #[serde(rename = "delivered")] + Delivered, +} + +impl Default for Status { + fn default() -> Status { + Self::Placed + } +} + diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/.openapi-generator/FILES b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/.openapi-generator/FILES index 917d2d668aa5..bbf905beda5c 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/.openapi-generator/FILES +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/.openapi-generator/FILES @@ -8,6 +8,7 @@ docs/ApiResponse.md docs/ArrayItemRefTest.md docs/Baz.md docs/Category.md +docs/DuplicateOneOf.md docs/DuplicateTest.md docs/Duplicatetest.md docs/EnumArrayTesting.md @@ -32,6 +33,8 @@ docs/UniqueItemArrayTesting.md docs/User.md docs/UserApi.md docs/Vehicle.md +docs/WithInnerOneOf.md +docs/WithInnerOneOfFoo.md git_push.sh src/apis/configuration.rs src/apis/fake_api.rs @@ -48,6 +51,7 @@ src/models/api_response.rs src/models/array_item_ref_test.rs src/models/baz.rs src/models/category.rs +src/models/duplicate_one_of.rs src/models/duplicate_test.rs src/models/duplicatetest.rs src/models/enum_array_testing.rs @@ -67,3 +71,5 @@ src/models/type_testing.rs src/models/unique_item_array_testing.rs src/models/user.rs src/models/vehicle.rs +src/models/with_inner_one_of.rs +src/models/with_inner_one_of_foo.rs diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/README.md b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/README.md index 7796e5b6cdb6..d57b543b1729 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/README.md +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/README.md @@ -61,6 +61,7 @@ Class | Method | HTTP request | Description - [ArrayItemRefTest](docs/ArrayItemRefTest.md) - [Baz](docs/Baz.md) - [Category](docs/Category.md) + - [DuplicateOneOf](docs/DuplicateOneOf.md) - [DuplicateTest](docs/DuplicateTest.md) - [Duplicatetest](docs/Duplicatetest.md) - [EnumArrayTesting](docs/EnumArrayTesting.md) @@ -80,6 +81,8 @@ Class | Method | HTTP request | Description - [UniqueItemArrayTesting](docs/UniqueItemArrayTesting.md) - [User](docs/User.md) - [Vehicle](docs/Vehicle.md) + - [WithInnerOneOf](docs/WithInnerOneOf.md) + - [WithInnerOneOfFoo](docs/WithInnerOneOfFoo.md) To get access to the crate's generated documentation, use: diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/DuplicateOneOf.md b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/DuplicateOneOf.md new file mode 100644 index 000000000000..22b6b00f001b --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/DuplicateOneOf.md @@ -0,0 +1,11 @@ +# DuplicateOneOf + +## Enum Variants + +| Name | Description | +|---- | -----| +| Order | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/WithInnerOneOf.md b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/WithInnerOneOf.md new file mode 100644 index 000000000000..5a91d39893fc --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/WithInnerOneOf.md @@ -0,0 +1,11 @@ +# WithInnerOneOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**foo** | Option<[**models::WithInnerOneOfFoo**](WithInnerOneOf_foo.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/WithInnerOneOfFoo.md b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/WithInnerOneOfFoo.md new file mode 100644 index 000000000000..fcf524123aca --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/WithInnerOneOfFoo.md @@ -0,0 +1,11 @@ +# WithInnerOneOfFoo + +## Enum Variants + +| Name | Description | +|---- | -----| +| Order | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/duplicate_one_of.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/duplicate_one_of.rs new file mode 100644 index 000000000000..e1039b65bcf7 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/duplicate_one_of.rs @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DuplicateOneOf { + Order(Box), +} + +impl Default for DuplicateOneOf { + fn default() -> Self { + Self::Order(Default::default()) + } +} +/// Order Status +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "placed")] + Placed, + #[serde(rename = "approved")] + Approved, + #[serde(rename = "delivered")] + Delivered, +} + +impl Default for Status { + fn default() -> Status { + Self::Placed + } +} + diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/mod.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/mod.rs index aada8fbd0f5a..7a29904ca382 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/mod.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/mod.rs @@ -10,6 +10,8 @@ pub mod baz; pub use self::baz::Baz; pub mod category; pub use self::category::Category; +pub mod duplicate_one_of; +pub use self::duplicate_one_of::DuplicateOneOf; pub mod duplicate_test; pub use self::duplicate_test::DuplicateTest; pub mod duplicatetest; @@ -48,6 +50,10 @@ pub mod user; pub use self::user::User; pub mod vehicle; pub use self::vehicle::Vehicle; +pub mod with_inner_one_of; +pub use self::with_inner_one_of::WithInnerOneOf; +pub mod with_inner_one_of_foo; +pub use self::with_inner_one_of_foo::WithInnerOneOfFoo; use serde::{Deserialize, Deserializer, Serializer}; use serde_with::{de::DeserializeAsWrap, ser::SerializeAsWrap, DeserializeAs, SerializeAs}; use std::marker::PhantomData; diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/with_inner_one_of.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/with_inner_one_of.rs new file mode 100644 index 000000000000..625b96ba3e1c --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/with_inner_one_of.rs @@ -0,0 +1,27 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct WithInnerOneOf { + #[serde(rename = "foo", skip_serializing_if = "Option::is_none")] + pub foo: Option>, +} + +impl WithInnerOneOf { + pub fn new() -> WithInnerOneOf { + WithInnerOneOf { + foo: None, + } + } +} + diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/with_inner_one_of_foo.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/with_inner_one_of_foo.rs new file mode 100644 index 000000000000..26ed4ce5f116 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/with_inner_one_of_foo.rs @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum WithInnerOneOfFoo { + Order(Box), +} + +impl Default for WithInnerOneOfFoo { + fn default() -> Self { + Self::Order(Default::default()) + } +} +/// Order Status +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "placed")] + Placed, + #[serde(rename = "approved")] + Approved, + #[serde(rename = "delivered")] + Delivered, +} + +impl Default for Status { + fn default() -> Status { + Self::Placed + } +} + diff --git a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/.openapi-generator/FILES b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/.openapi-generator/FILES index f30b5806dffe..8f143efb2ca3 100644 --- a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/.openapi-generator/FILES +++ b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/.openapi-generator/FILES @@ -9,6 +9,7 @@ docs/FooApiResponse.md docs/FooArrayItemRefTest.md docs/FooBaz.md docs/FooCategory.md +docs/FooDuplicateOneOf.md docs/FooDuplicateTest.md docs/FooDuplicatetest.md docs/FooEnumArrayTesting.md @@ -28,6 +29,8 @@ docs/FooTypeTesting.md docs/FooUniqueItemArrayTesting.md docs/FooUser.md docs/FooVehicle.md +docs/FooWithInnerOneOf.md +docs/FooWithInnerOneOfFoo.md docs/PetApi.md docs/StoreApi.md docs/TestingApi.md @@ -48,6 +51,7 @@ src/models/foo_api_response.rs src/models/foo_array_item_ref_test.rs src/models/foo_baz.rs src/models/foo_category.rs +src/models/foo_duplicate_one_of.rs src/models/foo_duplicate_test.rs src/models/foo_duplicatetest.rs src/models/foo_enum_array_testing.rs @@ -66,4 +70,6 @@ src/models/foo_type_testing.rs src/models/foo_unique_item_array_testing.rs src/models/foo_user.rs src/models/foo_vehicle.rs +src/models/foo_with_inner_one_of.rs +src/models/foo_with_inner_one_of_foo.rs src/models/mod.rs 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 22beee371b7f..87918a9c4637 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 @@ -61,6 +61,7 @@ Class | Method | HTTP request | Description - [FooArrayItemRefTest](docs/FooArrayItemRefTest.md) - [FooBaz](docs/FooBaz.md) - [FooCategory](docs/FooCategory.md) + - [FooDuplicateOneOf](docs/FooDuplicateOneOf.md) - [FooDuplicateTest](docs/FooDuplicateTest.md) - [FooDuplicatetest](docs/FooDuplicatetest.md) - [FooEnumArrayTesting](docs/FooEnumArrayTesting.md) @@ -80,6 +81,8 @@ Class | Method | HTTP request | Description - [FooUniqueItemArrayTesting](docs/FooUniqueItemArrayTesting.md) - [FooUser](docs/FooUser.md) - [FooVehicle](docs/FooVehicle.md) + - [FooWithInnerOneOf](docs/FooWithInnerOneOf.md) + - [FooWithInnerOneOfFoo](docs/FooWithInnerOneOfFoo.md) To get access to the crate's generated documentation, use: diff --git a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/FooDuplicateOneOf.md b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/FooDuplicateOneOf.md new file mode 100644 index 000000000000..4211ad2165bf --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/FooDuplicateOneOf.md @@ -0,0 +1,11 @@ +# FooDuplicateOneOf + +## Enum Variants + +| Name | Description | +|---- | -----| +| FooOrder | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/FooWithInnerOneOf.md b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/FooWithInnerOneOf.md new file mode 100644 index 000000000000..03ca179c709c --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/FooWithInnerOneOf.md @@ -0,0 +1,11 @@ +# FooWithInnerOneOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**foo** | Option<[**models::FooWithInnerOneOfFoo**](WithInnerOneOf_foo.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/FooWithInnerOneOfFoo.md b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/FooWithInnerOneOfFoo.md new file mode 100644 index 000000000000..ab75509a1964 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/FooWithInnerOneOfFoo.md @@ -0,0 +1,11 @@ +# FooWithInnerOneOfFoo + +## Enum Variants + +| Name | Description | +|---- | -----| +| FooOrder | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/foo_duplicate_one_of.rs b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/foo_duplicate_one_of.rs new file mode 100644 index 000000000000..088a6056eea9 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/foo_duplicate_one_of.rs @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum FooDuplicateOneOf { + FooOrder(Box), +} + +impl Default for FooDuplicateOneOf { + fn default() -> Self { + Self::FooOrder(Default::default()) + } +} +/// Order Status +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "placed")] + Placed, + #[serde(rename = "approved")] + Approved, + #[serde(rename = "delivered")] + shipped, +} + +impl Default for Status { + fn default() -> Status { + Self::Placed + } +} + diff --git a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/foo_with_inner_one_of.rs b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/foo_with_inner_one_of.rs new file mode 100644 index 000000000000..4c848a833fde --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/foo_with_inner_one_of.rs @@ -0,0 +1,27 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct FooWithInnerOneOf { + #[serde(rename = "foo", skip_serializing_if = "Option::is_none")] + pub foo: Option>, +} + +impl FooWithInnerOneOf { + pub fn new() -> FooWithInnerOneOf { + FooWithInnerOneOf { + foo: None, + } + } +} + diff --git a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/foo_with_inner_one_of_foo.rs b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/foo_with_inner_one_of_foo.rs new file mode 100644 index 000000000000..8dea145e3983 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/foo_with_inner_one_of_foo.rs @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum FooWithInnerOneOfFoo { + FooOrder(Box), +} + +impl Default for FooWithInnerOneOfFoo { + fn default() -> Self { + Self::FooOrder(Default::default()) + } +} +/// Order Status +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "placed")] + Placed, + #[serde(rename = "approved")] + Approved, + #[serde(rename = "delivered")] + shipped, +} + +impl Default for Status { + fn default() -> Status { + Self::Placed + } +} + diff --git a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/mod.rs b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/mod.rs index 4bf93a9d6c4a..c871ecdc4221 100644 --- a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/mod.rs +++ b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/mod.rs @@ -10,6 +10,8 @@ pub mod foo_baz; pub use self::foo_baz::FooBaz; pub mod foo_category; pub use self::foo_category::FooCategory; +pub mod foo_duplicate_one_of; +pub use self::foo_duplicate_one_of::FooDuplicateOneOf; pub mod foo_duplicate_test; pub use self::foo_duplicate_test::FooDuplicateTest; pub mod foo_duplicatetest; @@ -48,6 +50,10 @@ pub mod foo_user; pub use self::foo_user::FooUser; pub mod foo_vehicle; pub use self::foo_vehicle::FooVehicle; +pub mod foo_with_inner_one_of; +pub use self::foo_with_inner_one_of::FooWithInnerOneOf; +pub mod foo_with_inner_one_of_foo; +pub use self::foo_with_inner_one_of_foo::FooWithInnerOneOfFoo; use serde::{Deserialize, Deserializer, Serializer}; use serde_with::{de::DeserializeAsWrap, ser::SerializeAsWrap, DeserializeAs, SerializeAs}; use std::marker::PhantomData; diff --git a/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/FILES b/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/FILES index 917d2d668aa5..bbf905beda5c 100644 --- a/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/FILES +++ b/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/FILES @@ -8,6 +8,7 @@ docs/ApiResponse.md docs/ArrayItemRefTest.md docs/Baz.md docs/Category.md +docs/DuplicateOneOf.md docs/DuplicateTest.md docs/Duplicatetest.md docs/EnumArrayTesting.md @@ -32,6 +33,8 @@ docs/UniqueItemArrayTesting.md docs/User.md docs/UserApi.md docs/Vehicle.md +docs/WithInnerOneOf.md +docs/WithInnerOneOfFoo.md git_push.sh src/apis/configuration.rs src/apis/fake_api.rs @@ -48,6 +51,7 @@ src/models/api_response.rs src/models/array_item_ref_test.rs src/models/baz.rs src/models/category.rs +src/models/duplicate_one_of.rs src/models/duplicate_test.rs src/models/duplicatetest.rs src/models/enum_array_testing.rs @@ -67,3 +71,5 @@ src/models/type_testing.rs src/models/unique_item_array_testing.rs src/models/user.rs src/models/vehicle.rs +src/models/with_inner_one_of.rs +src/models/with_inner_one_of_foo.rs diff --git a/samples/client/petstore/rust/reqwest/petstore/README.md b/samples/client/petstore/rust/reqwest/petstore/README.md index d0e487fa6291..799a40b51908 100644 --- a/samples/client/petstore/rust/reqwest/petstore/README.md +++ b/samples/client/petstore/rust/reqwest/petstore/README.md @@ -61,6 +61,7 @@ Class | Method | HTTP request | Description - [ArrayItemRefTest](docs/ArrayItemRefTest.md) - [Baz](docs/Baz.md) - [Category](docs/Category.md) + - [DuplicateOneOf](docs/DuplicateOneOf.md) - [DuplicateTest](docs/DuplicateTest.md) - [Duplicatetest](docs/Duplicatetest.md) - [EnumArrayTesting](docs/EnumArrayTesting.md) @@ -80,6 +81,8 @@ Class | Method | HTTP request | Description - [UniqueItemArrayTesting](docs/UniqueItemArrayTesting.md) - [User](docs/User.md) - [Vehicle](docs/Vehicle.md) + - [WithInnerOneOf](docs/WithInnerOneOf.md) + - [WithInnerOneOfFoo](docs/WithInnerOneOfFoo.md) To get access to the crate's generated documentation, use: diff --git a/samples/client/petstore/rust/reqwest/petstore/docs/DuplicateOneOf.md b/samples/client/petstore/rust/reqwest/petstore/docs/DuplicateOneOf.md new file mode 100644 index 000000000000..22b6b00f001b --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore/docs/DuplicateOneOf.md @@ -0,0 +1,11 @@ +# DuplicateOneOf + +## Enum Variants + +| Name | Description | +|---- | -----| +| Order | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/reqwest/petstore/docs/WithInnerOneOf.md b/samples/client/petstore/rust/reqwest/petstore/docs/WithInnerOneOf.md new file mode 100644 index 000000000000..5a91d39893fc --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore/docs/WithInnerOneOf.md @@ -0,0 +1,11 @@ +# WithInnerOneOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**foo** | Option<[**models::WithInnerOneOfFoo**](WithInnerOneOf_foo.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/reqwest/petstore/docs/WithInnerOneOfFoo.md b/samples/client/petstore/rust/reqwest/petstore/docs/WithInnerOneOfFoo.md new file mode 100644 index 000000000000..fcf524123aca --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore/docs/WithInnerOneOfFoo.md @@ -0,0 +1,11 @@ +# WithInnerOneOfFoo + +## Enum Variants + +| Name | Description | +|---- | -----| +| Order | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/duplicate_one_of.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/duplicate_one_of.rs new file mode 100644 index 000000000000..ad47a777daec --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/duplicate_one_of.rs @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DuplicateOneOf { + Order(Box), +} + +impl Default for DuplicateOneOf { + fn default() -> Self { + Self::Order(Default::default()) + } +} +/// Order Status +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "placed")] + Placed, + #[serde(rename = "approved")] + Approved, + #[serde(rename = "delivered")] + shipped, +} + +impl Default for Status { + fn default() -> Status { + Self::Placed + } +} + diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/mod.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/mod.rs index aada8fbd0f5a..7a29904ca382 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/mod.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/mod.rs @@ -10,6 +10,8 @@ pub mod baz; pub use self::baz::Baz; pub mod category; pub use self::category::Category; +pub mod duplicate_one_of; +pub use self::duplicate_one_of::DuplicateOneOf; pub mod duplicate_test; pub use self::duplicate_test::DuplicateTest; pub mod duplicatetest; @@ -48,6 +50,10 @@ pub mod user; pub use self::user::User; pub mod vehicle; pub use self::vehicle::Vehicle; +pub mod with_inner_one_of; +pub use self::with_inner_one_of::WithInnerOneOf; +pub mod with_inner_one_of_foo; +pub use self::with_inner_one_of_foo::WithInnerOneOfFoo; use serde::{Deserialize, Deserializer, Serializer}; use serde_with::{de::DeserializeAsWrap, ser::SerializeAsWrap, DeserializeAs, SerializeAs}; use std::marker::PhantomData; diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/with_inner_one_of.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/with_inner_one_of.rs new file mode 100644 index 000000000000..625b96ba3e1c --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/with_inner_one_of.rs @@ -0,0 +1,27 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct WithInnerOneOf { + #[serde(rename = "foo", skip_serializing_if = "Option::is_none")] + pub foo: Option>, +} + +impl WithInnerOneOf { + pub fn new() -> WithInnerOneOf { + WithInnerOneOf { + foo: None, + } + } +} + diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/with_inner_one_of_foo.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/with_inner_one_of_foo.rs new file mode 100644 index 000000000000..9917806aa62b --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/with_inner_one_of_foo.rs @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum WithInnerOneOfFoo { + Order(Box), +} + +impl Default for WithInnerOneOfFoo { + fn default() -> Self { + Self::Order(Default::default()) + } +} +/// Order Status +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "placed")] + Placed, + #[serde(rename = "approved")] + Approved, + #[serde(rename = "delivered")] + shipped, +} + +impl Default for Status { + fn default() -> Status { + Self::Placed + } +} + From cc880bda0231b4ec6f73fedac359d70f5161c628 Mon Sep 17 00:00:00 2001 From: Ross Sullivan Date: Tue, 29 Apr 2025 13:00:30 +0900 Subject: [PATCH 3/5] fix: Fixed regression with oneOf+discriminator --- .../java/org/openapitools/codegen/utils/ModelUtils.java | 6 +++++- .../others/rust/hyper/oneOf-reuseRef/src/models/fruit.rs | 2 ++ .../others/rust/reqwest/oneOf-reuseRef/src/models/fruit.rs | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java index 7bfb1c31dca2..c499dec694c9 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java @@ -2244,7 +2244,7 @@ public static Schema simplyOneOfAnyOfWithOnlyOneNonNullSubSchema(OpenAPI openAPI } /** - * Removes duplicate `oneOf` from a given schema + * Removes duplicate `oneOf` from a given schema if it does not also have a discriminator. * * @param schema Schema */ @@ -2252,6 +2252,10 @@ public static void deduplicateOneOfSchema(Schema schema) { if (schema.getOneOf() == null) { return; } + if (schema.getDiscriminator() != null) { + return; // Duplicate oneOf are allowed if there is a discriminator that can be used to separate them. + } + Set deduplicated = new LinkedHashSet<>(schema.getOneOf()); schema.setOneOf(new ArrayList<>(deduplicated)); } diff --git a/samples/client/others/rust/hyper/oneOf-reuseRef/src/models/fruit.rs b/samples/client/others/rust/hyper/oneOf-reuseRef/src/models/fruit.rs index 5073f25dab84..cd28f15520c0 100644 --- a/samples/client/others/rust/hyper/oneOf-reuseRef/src/models/fruit.rs +++ b/samples/client/others/rust/hyper/oneOf-reuseRef/src/models/fruit.rs @@ -16,6 +16,8 @@ use serde::{Deserialize, Serialize}; pub enum Fruit { #[serde(rename="green_apple")] GreenApple(Box), + #[serde(rename="red_apple")] + RedApple(Box), #[serde(rename="banana")] Banana(Box), } diff --git a/samples/client/others/rust/reqwest/oneOf-reuseRef/src/models/fruit.rs b/samples/client/others/rust/reqwest/oneOf-reuseRef/src/models/fruit.rs index 5073f25dab84..cd28f15520c0 100644 --- a/samples/client/others/rust/reqwest/oneOf-reuseRef/src/models/fruit.rs +++ b/samples/client/others/rust/reqwest/oneOf-reuseRef/src/models/fruit.rs @@ -16,6 +16,8 @@ use serde::{Deserialize, Serialize}; pub enum Fruit { #[serde(rename="green_apple")] GreenApple(Box), + #[serde(rename="red_apple")] + RedApple(Box), #[serde(rename="banana")] Banana(Box), } From af498c5810ae12470be7a87b6c334cba615fcc9e Mon Sep 17 00:00:00 2001 From: Ross Sullivan Date: Tue, 29 Apr 2025 13:16:34 +0900 Subject: [PATCH 4/5] fix: Fixed possible null pointer during schema preprocessing --- .../src/main/java/org/openapitools/codegen/DefaultCodegen.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index 7d6fc7ffca40..a723cd256af4 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -1009,7 +1009,7 @@ public void postProcessParameter(CodegenParameter parameter) { @Override @SuppressWarnings("unused") public void preprocessOpenAPI(OpenAPI openAPI) { - if (openAPI.getComponents() != null) { + if (openAPI.getComponents() != null && openAPI.getComponents().getSchemas() != null) { // Remove duplicate oneOf Map schemas = new HashMap<>(openAPI.getComponents().getSchemas()); for (var schema : schemas.values()) { From ba437f3042736b4c6bb4056365b7d38de570974e Mon Sep 17 00:00:00 2001 From: Ross Sullivan Date: Tue, 29 Apr 2025 20:46:52 +0900 Subject: [PATCH 5/5] refactor: Moved oneOf deduplication to OpenAPINormalizer --- .../java/org/openapitools/codegen/DefaultCodegen.java | 8 -------- .../java/org/openapitools/codegen/OpenAPINormalizer.java | 3 +++ .../petstore/rust/hyper/petstore/.openapi-generator/FILES | 4 ---- samples/client/petstore/rust/hyper/petstore/README.md | 2 -- .../petstore/rust/hyper/petstore/docs/WithInnerOneOf.md | 2 +- .../client/petstore/rust/hyper/petstore/src/models/mod.rs | 4 ---- .../rust/hyper/petstore/src/models/with_inner_one_of.rs | 2 +- .../rust/hyper0x/petstore/.openapi-generator/FILES | 4 ---- samples/client/petstore/rust/hyper0x/petstore/README.md | 2 -- .../petstore/rust/hyper0x/petstore/docs/WithInnerOneOf.md | 2 +- .../petstore/rust/hyper0x/petstore/src/models/mod.rs | 4 ---- .../rust/hyper0x/petstore/src/models/with_inner_one_of.rs | 2 +- .../rust/reqwest-trait/petstore/.openapi-generator/FILES | 4 ---- .../client/petstore/rust/reqwest-trait/petstore/README.md | 2 -- .../rust/reqwest-trait/petstore/docs/WithInnerOneOf.md | 2 +- .../rust/reqwest-trait/petstore/src/models/mod.rs | 4 ---- .../petstore/src/models/with_inner_one_of.rs | 2 +- .../petstore-async-middleware/.openapi-generator/FILES | 4 ---- .../rust/reqwest/petstore-async-middleware/README.md | 2 -- .../petstore-async-middleware/docs/WithInnerOneOf.md | 2 +- .../reqwest/petstore-async-middleware/src/models/mod.rs | 4 ---- .../src/models/with_inner_one_of.rs | 2 +- .../petstore-async-tokensource/.openapi-generator/FILES | 4 ---- .../rust/reqwest/petstore-async-tokensource/README.md | 2 -- .../petstore-async-tokensource/docs/WithInnerOneOf.md | 2 +- .../reqwest/petstore-async-tokensource/src/models/mod.rs | 4 ---- .../src/models/with_inner_one_of.rs | 2 +- .../rust/reqwest/petstore-async/.openapi-generator/FILES | 4 ---- .../client/petstore/rust/reqwest/petstore-async/README.md | 2 -- .../rust/reqwest/petstore-async/docs/WithInnerOneOf.md | 2 +- .../rust/reqwest/petstore-async/src/models/mod.rs | 4 ---- .../petstore-async/src/models/with_inner_one_of.rs | 2 +- .../reqwest/petstore-avoid-box/.openapi-generator/FILES | 4 ---- .../petstore/rust/reqwest/petstore-avoid-box/README.md | 2 -- .../reqwest/petstore-avoid-box/docs/WithInnerOneOf.md | 2 +- .../rust/reqwest/petstore-avoid-box/src/models/mod.rs | 4 ---- .../petstore-avoid-box/src/models/with_inner_one_of.rs | 2 +- .../petstore-awsv4signature/.openapi-generator/FILES | 4 ---- .../rust/reqwest/petstore-awsv4signature/README.md | 2 -- .../petstore-awsv4signature/docs/WithInnerOneOf.md | 2 +- .../reqwest/petstore-awsv4signature/src/models/mod.rs | 4 ---- .../src/models/with_inner_one_of.rs | 2 +- .../petstore-model-name-prefix/.openapi-generator/FILES | 4 ---- .../rust/reqwest/petstore-model-name-prefix/README.md | 2 -- .../petstore-model-name-prefix/docs/FooWithInnerOneOf.md | 2 +- .../src/models/foo_with_inner_one_of.rs | 2 +- .../reqwest/petstore-model-name-prefix/src/models/mod.rs | 4 ---- .../rust/reqwest/petstore/.openapi-generator/FILES | 4 ---- samples/client/petstore/rust/reqwest/petstore/README.md | 2 -- .../petstore/rust/reqwest/petstore/docs/WithInnerOneOf.md | 2 +- .../petstore/rust/reqwest/petstore/src/models/mod.rs | 4 ---- .../rust/reqwest/petstore/src/models/with_inner_one_of.rs | 2 +- 52 files changed, 23 insertions(+), 128 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index a723cd256af4..b3cbca3dd93d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -1009,14 +1009,6 @@ public void postProcessParameter(CodegenParameter parameter) { @Override @SuppressWarnings("unused") public void preprocessOpenAPI(OpenAPI openAPI) { - if (openAPI.getComponents() != null && openAPI.getComponents().getSchemas() != null) { - // Remove duplicate oneOf - Map schemas = new HashMap<>(openAPI.getComponents().getSchemas()); - for (var schema : schemas.values()) { - ModelUtils.deduplicateOneOfSchema(schema); - } - } - if (useOneOfInterfaces && openAPI.getComponents() != null) { // we process the openapi schema here to find oneOf schemas and create interface models for them Map schemas = new HashMap<>(openAPI.getComponents().getSchemas()); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/OpenAPINormalizer.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/OpenAPINormalizer.java index 02ecc790d257..a69a79a1871d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/OpenAPINormalizer.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/OpenAPINormalizer.java @@ -922,6 +922,9 @@ protected Schema normalizeAllOfWithProperties(Schema schema, Set visited } protected Schema normalizeOneOf(Schema schema, Set visitedSchemas) { + // Remove duplicate oneOf entries + ModelUtils.deduplicateOneOfSchema(schema); + // simplify first as the schema may no longer be a oneOf after processing the rule below schema = processSimplifyOneOf(schema); diff --git a/samples/client/petstore/rust/hyper/petstore/.openapi-generator/FILES b/samples/client/petstore/rust/hyper/petstore/.openapi-generator/FILES index d562641221d2..f56a8ace96e1 100644 --- a/samples/client/petstore/rust/hyper/petstore/.openapi-generator/FILES +++ b/samples/client/petstore/rust/hyper/petstore/.openapi-generator/FILES @@ -8,7 +8,6 @@ docs/ApiResponse.md docs/ArrayItemRefTest.md docs/Baz.md docs/Category.md -docs/DuplicateOneOf.md docs/DuplicateTest.md docs/Duplicatetest.md docs/EnumArrayTesting.md @@ -34,7 +33,6 @@ docs/User.md docs/UserApi.md docs/Vehicle.md docs/WithInnerOneOf.md -docs/WithInnerOneOfFoo.md git_push.sh src/apis/client.rs src/apis/configuration.rs @@ -53,7 +51,6 @@ src/models/api_response.rs src/models/array_item_ref_test.rs src/models/baz.rs src/models/category.rs -src/models/duplicate_one_of.rs src/models/duplicate_test.rs src/models/duplicatetest.rs src/models/enum_array_testing.rs @@ -74,4 +71,3 @@ src/models/unique_item_array_testing.rs src/models/user.rs src/models/vehicle.rs src/models/with_inner_one_of.rs -src/models/with_inner_one_of_foo.rs diff --git a/samples/client/petstore/rust/hyper/petstore/README.md b/samples/client/petstore/rust/hyper/petstore/README.md index 854c07d03617..164048d493b3 100644 --- a/samples/client/petstore/rust/hyper/petstore/README.md +++ b/samples/client/petstore/rust/hyper/petstore/README.md @@ -61,7 +61,6 @@ Class | Method | HTTP request | Description - [ArrayItemRefTest](docs/ArrayItemRefTest.md) - [Baz](docs/Baz.md) - [Category](docs/Category.md) - - [DuplicateOneOf](docs/DuplicateOneOf.md) - [DuplicateTest](docs/DuplicateTest.md) - [Duplicatetest](docs/Duplicatetest.md) - [EnumArrayTesting](docs/EnumArrayTesting.md) @@ -82,7 +81,6 @@ Class | Method | HTTP request | Description - [User](docs/User.md) - [Vehicle](docs/Vehicle.md) - [WithInnerOneOf](docs/WithInnerOneOf.md) - - [WithInnerOneOfFoo](docs/WithInnerOneOfFoo.md) To get access to the crate's generated documentation, use: diff --git a/samples/client/petstore/rust/hyper/petstore/docs/WithInnerOneOf.md b/samples/client/petstore/rust/hyper/petstore/docs/WithInnerOneOf.md index 5a91d39893fc..93c6ada0387f 100644 --- a/samples/client/petstore/rust/hyper/petstore/docs/WithInnerOneOf.md +++ b/samples/client/petstore/rust/hyper/petstore/docs/WithInnerOneOf.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**foo** | Option<[**models::WithInnerOneOfFoo**](WithInnerOneOf_foo.md)> | | [optional] +**foo** | Option<[**models::Order**](Order.md)> | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/mod.rs b/samples/client/petstore/rust/hyper/petstore/src/models/mod.rs index 7a29904ca382..7cdaa063edb5 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/mod.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/mod.rs @@ -10,8 +10,6 @@ pub mod baz; pub use self::baz::Baz; pub mod category; pub use self::category::Category; -pub mod duplicate_one_of; -pub use self::duplicate_one_of::DuplicateOneOf; pub mod duplicate_test; pub use self::duplicate_test::DuplicateTest; pub mod duplicatetest; @@ -52,8 +50,6 @@ pub mod vehicle; pub use self::vehicle::Vehicle; pub mod with_inner_one_of; pub use self::with_inner_one_of::WithInnerOneOf; -pub mod with_inner_one_of_foo; -pub use self::with_inner_one_of_foo::WithInnerOneOfFoo; use serde::{Deserialize, Deserializer, Serializer}; use serde_with::{de::DeserializeAsWrap, ser::SerializeAsWrap, DeserializeAs, SerializeAs}; use std::marker::PhantomData; diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/with_inner_one_of.rs b/samples/client/petstore/rust/hyper/petstore/src/models/with_inner_one_of.rs index 625b96ba3e1c..a00c4e1c375e 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/with_inner_one_of.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/with_inner_one_of.rs @@ -14,7 +14,7 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct WithInnerOneOf { #[serde(rename = "foo", skip_serializing_if = "Option::is_none")] - pub foo: Option>, + pub foo: Option>, } impl WithInnerOneOf { diff --git a/samples/client/petstore/rust/hyper0x/petstore/.openapi-generator/FILES b/samples/client/petstore/rust/hyper0x/petstore/.openapi-generator/FILES index bbf905beda5c..bb1f8da36d11 100644 --- a/samples/client/petstore/rust/hyper0x/petstore/.openapi-generator/FILES +++ b/samples/client/petstore/rust/hyper0x/petstore/.openapi-generator/FILES @@ -8,7 +8,6 @@ docs/ApiResponse.md docs/ArrayItemRefTest.md docs/Baz.md docs/Category.md -docs/DuplicateOneOf.md docs/DuplicateTest.md docs/Duplicatetest.md docs/EnumArrayTesting.md @@ -34,7 +33,6 @@ docs/User.md docs/UserApi.md docs/Vehicle.md docs/WithInnerOneOf.md -docs/WithInnerOneOfFoo.md git_push.sh src/apis/configuration.rs src/apis/fake_api.rs @@ -51,7 +49,6 @@ src/models/api_response.rs src/models/array_item_ref_test.rs src/models/baz.rs src/models/category.rs -src/models/duplicate_one_of.rs src/models/duplicate_test.rs src/models/duplicatetest.rs src/models/enum_array_testing.rs @@ -72,4 +69,3 @@ src/models/unique_item_array_testing.rs src/models/user.rs src/models/vehicle.rs src/models/with_inner_one_of.rs -src/models/with_inner_one_of_foo.rs diff --git a/samples/client/petstore/rust/hyper0x/petstore/README.md b/samples/client/petstore/rust/hyper0x/petstore/README.md index cde988eb1510..567353a1d2d9 100644 --- a/samples/client/petstore/rust/hyper0x/petstore/README.md +++ b/samples/client/petstore/rust/hyper0x/petstore/README.md @@ -61,7 +61,6 @@ Class | Method | HTTP request | Description - [ArrayItemRefTest](docs/ArrayItemRefTest.md) - [Baz](docs/Baz.md) - [Category](docs/Category.md) - - [DuplicateOneOf](docs/DuplicateOneOf.md) - [DuplicateTest](docs/DuplicateTest.md) - [Duplicatetest](docs/Duplicatetest.md) - [EnumArrayTesting](docs/EnumArrayTesting.md) @@ -82,7 +81,6 @@ Class | Method | HTTP request | Description - [User](docs/User.md) - [Vehicle](docs/Vehicle.md) - [WithInnerOneOf](docs/WithInnerOneOf.md) - - [WithInnerOneOfFoo](docs/WithInnerOneOfFoo.md) To get access to the crate's generated documentation, use: diff --git a/samples/client/petstore/rust/hyper0x/petstore/docs/WithInnerOneOf.md b/samples/client/petstore/rust/hyper0x/petstore/docs/WithInnerOneOf.md index 5a91d39893fc..93c6ada0387f 100644 --- a/samples/client/petstore/rust/hyper0x/petstore/docs/WithInnerOneOf.md +++ b/samples/client/petstore/rust/hyper0x/petstore/docs/WithInnerOneOf.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**foo** | Option<[**models::WithInnerOneOfFoo**](WithInnerOneOf_foo.md)> | | [optional] +**foo** | Option<[**models::Order**](Order.md)> | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust/hyper0x/petstore/src/models/mod.rs b/samples/client/petstore/rust/hyper0x/petstore/src/models/mod.rs index 7a29904ca382..7cdaa063edb5 100644 --- a/samples/client/petstore/rust/hyper0x/petstore/src/models/mod.rs +++ b/samples/client/petstore/rust/hyper0x/petstore/src/models/mod.rs @@ -10,8 +10,6 @@ pub mod baz; pub use self::baz::Baz; pub mod category; pub use self::category::Category; -pub mod duplicate_one_of; -pub use self::duplicate_one_of::DuplicateOneOf; pub mod duplicate_test; pub use self::duplicate_test::DuplicateTest; pub mod duplicatetest; @@ -52,8 +50,6 @@ pub mod vehicle; pub use self::vehicle::Vehicle; pub mod with_inner_one_of; pub use self::with_inner_one_of::WithInnerOneOf; -pub mod with_inner_one_of_foo; -pub use self::with_inner_one_of_foo::WithInnerOneOfFoo; use serde::{Deserialize, Deserializer, Serializer}; use serde_with::{de::DeserializeAsWrap, ser::SerializeAsWrap, DeserializeAs, SerializeAs}; use std::marker::PhantomData; diff --git a/samples/client/petstore/rust/hyper0x/petstore/src/models/with_inner_one_of.rs b/samples/client/petstore/rust/hyper0x/petstore/src/models/with_inner_one_of.rs index 625b96ba3e1c..a00c4e1c375e 100644 --- a/samples/client/petstore/rust/hyper0x/petstore/src/models/with_inner_one_of.rs +++ b/samples/client/petstore/rust/hyper0x/petstore/src/models/with_inner_one_of.rs @@ -14,7 +14,7 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct WithInnerOneOf { #[serde(rename = "foo", skip_serializing_if = "Option::is_none")] - pub foo: Option>, + pub foo: Option>, } impl WithInnerOneOf { diff --git a/samples/client/petstore/rust/reqwest-trait/petstore/.openapi-generator/FILES b/samples/client/petstore/rust/reqwest-trait/petstore/.openapi-generator/FILES index bbf905beda5c..bb1f8da36d11 100644 --- a/samples/client/petstore/rust/reqwest-trait/petstore/.openapi-generator/FILES +++ b/samples/client/petstore/rust/reqwest-trait/petstore/.openapi-generator/FILES @@ -8,7 +8,6 @@ docs/ApiResponse.md docs/ArrayItemRefTest.md docs/Baz.md docs/Category.md -docs/DuplicateOneOf.md docs/DuplicateTest.md docs/Duplicatetest.md docs/EnumArrayTesting.md @@ -34,7 +33,6 @@ docs/User.md docs/UserApi.md docs/Vehicle.md docs/WithInnerOneOf.md -docs/WithInnerOneOfFoo.md git_push.sh src/apis/configuration.rs src/apis/fake_api.rs @@ -51,7 +49,6 @@ src/models/api_response.rs src/models/array_item_ref_test.rs src/models/baz.rs src/models/category.rs -src/models/duplicate_one_of.rs src/models/duplicate_test.rs src/models/duplicatetest.rs src/models/enum_array_testing.rs @@ -72,4 +69,3 @@ src/models/unique_item_array_testing.rs src/models/user.rs src/models/vehicle.rs src/models/with_inner_one_of.rs -src/models/with_inner_one_of_foo.rs diff --git a/samples/client/petstore/rust/reqwest-trait/petstore/README.md b/samples/client/petstore/rust/reqwest-trait/petstore/README.md index 799a40b51908..c9cc16b3075a 100644 --- a/samples/client/petstore/rust/reqwest-trait/petstore/README.md +++ b/samples/client/petstore/rust/reqwest-trait/petstore/README.md @@ -61,7 +61,6 @@ Class | Method | HTTP request | Description - [ArrayItemRefTest](docs/ArrayItemRefTest.md) - [Baz](docs/Baz.md) - [Category](docs/Category.md) - - [DuplicateOneOf](docs/DuplicateOneOf.md) - [DuplicateTest](docs/DuplicateTest.md) - [Duplicatetest](docs/Duplicatetest.md) - [EnumArrayTesting](docs/EnumArrayTesting.md) @@ -82,7 +81,6 @@ Class | Method | HTTP request | Description - [User](docs/User.md) - [Vehicle](docs/Vehicle.md) - [WithInnerOneOf](docs/WithInnerOneOf.md) - - [WithInnerOneOfFoo](docs/WithInnerOneOfFoo.md) To get access to the crate's generated documentation, use: diff --git a/samples/client/petstore/rust/reqwest-trait/petstore/docs/WithInnerOneOf.md b/samples/client/petstore/rust/reqwest-trait/petstore/docs/WithInnerOneOf.md index 5a91d39893fc..93c6ada0387f 100644 --- a/samples/client/petstore/rust/reqwest-trait/petstore/docs/WithInnerOneOf.md +++ b/samples/client/petstore/rust/reqwest-trait/petstore/docs/WithInnerOneOf.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**foo** | Option<[**models::WithInnerOneOfFoo**](WithInnerOneOf_foo.md)> | | [optional] +**foo** | Option<[**models::Order**](Order.md)> | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust/reqwest-trait/petstore/src/models/mod.rs b/samples/client/petstore/rust/reqwest-trait/petstore/src/models/mod.rs index 7a29904ca382..7cdaa063edb5 100644 --- a/samples/client/petstore/rust/reqwest-trait/petstore/src/models/mod.rs +++ b/samples/client/petstore/rust/reqwest-trait/petstore/src/models/mod.rs @@ -10,8 +10,6 @@ pub mod baz; pub use self::baz::Baz; pub mod category; pub use self::category::Category; -pub mod duplicate_one_of; -pub use self::duplicate_one_of::DuplicateOneOf; pub mod duplicate_test; pub use self::duplicate_test::DuplicateTest; pub mod duplicatetest; @@ -52,8 +50,6 @@ pub mod vehicle; pub use self::vehicle::Vehicle; pub mod with_inner_one_of; pub use self::with_inner_one_of::WithInnerOneOf; -pub mod with_inner_one_of_foo; -pub use self::with_inner_one_of_foo::WithInnerOneOfFoo; use serde::{Deserialize, Deserializer, Serializer}; use serde_with::{de::DeserializeAsWrap, ser::SerializeAsWrap, DeserializeAs, SerializeAs}; use std::marker::PhantomData; diff --git a/samples/client/petstore/rust/reqwest-trait/petstore/src/models/with_inner_one_of.rs b/samples/client/petstore/rust/reqwest-trait/petstore/src/models/with_inner_one_of.rs index 625b96ba3e1c..a00c4e1c375e 100644 --- a/samples/client/petstore/rust/reqwest-trait/petstore/src/models/with_inner_one_of.rs +++ b/samples/client/petstore/rust/reqwest-trait/petstore/src/models/with_inner_one_of.rs @@ -14,7 +14,7 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct WithInnerOneOf { #[serde(rename = "foo", skip_serializing_if = "Option::is_none")] - pub foo: Option>, + pub foo: Option>, } impl WithInnerOneOf { diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/.openapi-generator/FILES b/samples/client/petstore/rust/reqwest/petstore-async-middleware/.openapi-generator/FILES index bbf905beda5c..bb1f8da36d11 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/.openapi-generator/FILES +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/.openapi-generator/FILES @@ -8,7 +8,6 @@ docs/ApiResponse.md docs/ArrayItemRefTest.md docs/Baz.md docs/Category.md -docs/DuplicateOneOf.md docs/DuplicateTest.md docs/Duplicatetest.md docs/EnumArrayTesting.md @@ -34,7 +33,6 @@ docs/User.md docs/UserApi.md docs/Vehicle.md docs/WithInnerOneOf.md -docs/WithInnerOneOfFoo.md git_push.sh src/apis/configuration.rs src/apis/fake_api.rs @@ -51,7 +49,6 @@ src/models/api_response.rs src/models/array_item_ref_test.rs src/models/baz.rs src/models/category.rs -src/models/duplicate_one_of.rs src/models/duplicate_test.rs src/models/duplicatetest.rs src/models/enum_array_testing.rs @@ -72,4 +69,3 @@ src/models/unique_item_array_testing.rs src/models/user.rs src/models/vehicle.rs src/models/with_inner_one_of.rs -src/models/with_inner_one_of_foo.rs 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 7e05aa0991cc..a3bd1d246424 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/README.md +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/README.md @@ -61,7 +61,6 @@ Class | Method | HTTP request | Description - [ArrayItemRefTest](docs/ArrayItemRefTest.md) - [Baz](docs/Baz.md) - [Category](docs/Category.md) - - [DuplicateOneOf](docs/DuplicateOneOf.md) - [DuplicateTest](docs/DuplicateTest.md) - [Duplicatetest](docs/Duplicatetest.md) - [EnumArrayTesting](docs/EnumArrayTesting.md) @@ -82,7 +81,6 @@ Class | Method | HTTP request | Description - [User](docs/User.md) - [Vehicle](docs/Vehicle.md) - [WithInnerOneOf](docs/WithInnerOneOf.md) - - [WithInnerOneOfFoo](docs/WithInnerOneOfFoo.md) To get access to the crate's generated documentation, use: diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/WithInnerOneOf.md b/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/WithInnerOneOf.md index 5a91d39893fc..93c6ada0387f 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/WithInnerOneOf.md +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/WithInnerOneOf.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**foo** | Option<[**models::WithInnerOneOfFoo**](WithInnerOneOf_foo.md)> | | [optional] +**foo** | Option<[**models::Order**](Order.md)> | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/mod.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/mod.rs index 7a29904ca382..7cdaa063edb5 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/mod.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/mod.rs @@ -10,8 +10,6 @@ pub mod baz; pub use self::baz::Baz; pub mod category; pub use self::category::Category; -pub mod duplicate_one_of; -pub use self::duplicate_one_of::DuplicateOneOf; pub mod duplicate_test; pub use self::duplicate_test::DuplicateTest; pub mod duplicatetest; @@ -52,8 +50,6 @@ pub mod vehicle; pub use self::vehicle::Vehicle; pub mod with_inner_one_of; pub use self::with_inner_one_of::WithInnerOneOf; -pub mod with_inner_one_of_foo; -pub use self::with_inner_one_of_foo::WithInnerOneOfFoo; use serde::{Deserialize, Deserializer, Serializer}; use serde_with::{de::DeserializeAsWrap, ser::SerializeAsWrap, DeserializeAs, SerializeAs}; use std::marker::PhantomData; diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/with_inner_one_of.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/with_inner_one_of.rs index 625b96ba3e1c..a00c4e1c375e 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/with_inner_one_of.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/with_inner_one_of.rs @@ -14,7 +14,7 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct WithInnerOneOf { #[serde(rename = "foo", skip_serializing_if = "Option::is_none")] - pub foo: Option>, + pub foo: Option>, } impl WithInnerOneOf { diff --git a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/.openapi-generator/FILES b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/.openapi-generator/FILES index bbf905beda5c..bb1f8da36d11 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/.openapi-generator/FILES +++ b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/.openapi-generator/FILES @@ -8,7 +8,6 @@ docs/ApiResponse.md docs/ArrayItemRefTest.md docs/Baz.md docs/Category.md -docs/DuplicateOneOf.md docs/DuplicateTest.md docs/Duplicatetest.md docs/EnumArrayTesting.md @@ -34,7 +33,6 @@ docs/User.md docs/UserApi.md docs/Vehicle.md docs/WithInnerOneOf.md -docs/WithInnerOneOfFoo.md git_push.sh src/apis/configuration.rs src/apis/fake_api.rs @@ -51,7 +49,6 @@ src/models/api_response.rs src/models/array_item_ref_test.rs src/models/baz.rs src/models/category.rs -src/models/duplicate_one_of.rs src/models/duplicate_test.rs src/models/duplicatetest.rs src/models/enum_array_testing.rs @@ -72,4 +69,3 @@ src/models/unique_item_array_testing.rs src/models/user.rs src/models/vehicle.rs src/models/with_inner_one_of.rs -src/models/with_inner_one_of_foo.rs 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 72f2f4c77cd2..b717783e955d 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/README.md +++ b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/README.md @@ -61,7 +61,6 @@ Class | Method | HTTP request | Description - [ArrayItemRefTest](docs/ArrayItemRefTest.md) - [Baz](docs/Baz.md) - [Category](docs/Category.md) - - [DuplicateOneOf](docs/DuplicateOneOf.md) - [DuplicateTest](docs/DuplicateTest.md) - [Duplicatetest](docs/Duplicatetest.md) - [EnumArrayTesting](docs/EnumArrayTesting.md) @@ -82,7 +81,6 @@ Class | Method | HTTP request | Description - [User](docs/User.md) - [Vehicle](docs/Vehicle.md) - [WithInnerOneOf](docs/WithInnerOneOf.md) - - [WithInnerOneOfFoo](docs/WithInnerOneOfFoo.md) To get access to the crate's generated documentation, use: diff --git a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/WithInnerOneOf.md b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/WithInnerOneOf.md index 5a91d39893fc..93c6ada0387f 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/WithInnerOneOf.md +++ b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/WithInnerOneOf.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**foo** | Option<[**models::WithInnerOneOfFoo**](WithInnerOneOf_foo.md)> | | [optional] +**foo** | Option<[**models::Order**](Order.md)> | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/mod.rs b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/mod.rs index 7a29904ca382..7cdaa063edb5 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/mod.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/mod.rs @@ -10,8 +10,6 @@ pub mod baz; pub use self::baz::Baz; pub mod category; pub use self::category::Category; -pub mod duplicate_one_of; -pub use self::duplicate_one_of::DuplicateOneOf; pub mod duplicate_test; pub use self::duplicate_test::DuplicateTest; pub mod duplicatetest; @@ -52,8 +50,6 @@ pub mod vehicle; pub use self::vehicle::Vehicle; pub mod with_inner_one_of; pub use self::with_inner_one_of::WithInnerOneOf; -pub mod with_inner_one_of_foo; -pub use self::with_inner_one_of_foo::WithInnerOneOfFoo; use serde::{Deserialize, Deserializer, Serializer}; use serde_with::{de::DeserializeAsWrap, ser::SerializeAsWrap, DeserializeAs, SerializeAs}; use std::marker::PhantomData; diff --git a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/with_inner_one_of.rs b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/with_inner_one_of.rs index 625b96ba3e1c..a00c4e1c375e 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/with_inner_one_of.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/with_inner_one_of.rs @@ -14,7 +14,7 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct WithInnerOneOf { #[serde(rename = "foo", skip_serializing_if = "Option::is_none")] - pub foo: Option>, + pub foo: Option>, } impl WithInnerOneOf { diff --git a/samples/client/petstore/rust/reqwest/petstore-async/.openapi-generator/FILES b/samples/client/petstore/rust/reqwest/petstore-async/.openapi-generator/FILES index bbf905beda5c..bb1f8da36d11 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/.openapi-generator/FILES +++ b/samples/client/petstore/rust/reqwest/petstore-async/.openapi-generator/FILES @@ -8,7 +8,6 @@ docs/ApiResponse.md docs/ArrayItemRefTest.md docs/Baz.md docs/Category.md -docs/DuplicateOneOf.md docs/DuplicateTest.md docs/Duplicatetest.md docs/EnumArrayTesting.md @@ -34,7 +33,6 @@ docs/User.md docs/UserApi.md docs/Vehicle.md docs/WithInnerOneOf.md -docs/WithInnerOneOfFoo.md git_push.sh src/apis/configuration.rs src/apis/fake_api.rs @@ -51,7 +49,6 @@ src/models/api_response.rs src/models/array_item_ref_test.rs src/models/baz.rs src/models/category.rs -src/models/duplicate_one_of.rs src/models/duplicate_test.rs src/models/duplicatetest.rs src/models/enum_array_testing.rs @@ -72,4 +69,3 @@ src/models/unique_item_array_testing.rs src/models/user.rs src/models/vehicle.rs src/models/with_inner_one_of.rs -src/models/with_inner_one_of_foo.rs diff --git a/samples/client/petstore/rust/reqwest/petstore-async/README.md b/samples/client/petstore/rust/reqwest/petstore-async/README.md index d389686ce166..69502f2f6bef 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/README.md +++ b/samples/client/petstore/rust/reqwest/petstore-async/README.md @@ -61,7 +61,6 @@ Class | Method | HTTP request | Description - [ArrayItemRefTest](docs/ArrayItemRefTest.md) - [Baz](docs/Baz.md) - [Category](docs/Category.md) - - [DuplicateOneOf](docs/DuplicateOneOf.md) - [DuplicateTest](docs/DuplicateTest.md) - [Duplicatetest](docs/Duplicatetest.md) - [EnumArrayTesting](docs/EnumArrayTesting.md) @@ -82,7 +81,6 @@ Class | Method | HTTP request | Description - [User](docs/User.md) - [Vehicle](docs/Vehicle.md) - [WithInnerOneOf](docs/WithInnerOneOf.md) - - [WithInnerOneOfFoo](docs/WithInnerOneOfFoo.md) To get access to the crate's generated documentation, use: diff --git a/samples/client/petstore/rust/reqwest/petstore-async/docs/WithInnerOneOf.md b/samples/client/petstore/rust/reqwest/petstore-async/docs/WithInnerOneOf.md index 5a91d39893fc..93c6ada0387f 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/docs/WithInnerOneOf.md +++ b/samples/client/petstore/rust/reqwest/petstore-async/docs/WithInnerOneOf.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**foo** | Option<[**models::WithInnerOneOfFoo**](WithInnerOneOf_foo.md)> | | [optional] +**foo** | Option<[**models::Order**](Order.md)> | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/mod.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/mod.rs index 7a29904ca382..7cdaa063edb5 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/mod.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/mod.rs @@ -10,8 +10,6 @@ pub mod baz; pub use self::baz::Baz; pub mod category; pub use self::category::Category; -pub mod duplicate_one_of; -pub use self::duplicate_one_of::DuplicateOneOf; pub mod duplicate_test; pub use self::duplicate_test::DuplicateTest; pub mod duplicatetest; @@ -52,8 +50,6 @@ pub mod vehicle; pub use self::vehicle::Vehicle; pub mod with_inner_one_of; pub use self::with_inner_one_of::WithInnerOneOf; -pub mod with_inner_one_of_foo; -pub use self::with_inner_one_of_foo::WithInnerOneOfFoo; use serde::{Deserialize, Deserializer, Serializer}; use serde_with::{de::DeserializeAsWrap, ser::SerializeAsWrap, DeserializeAs, SerializeAs}; use std::marker::PhantomData; diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/with_inner_one_of.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/with_inner_one_of.rs index 625b96ba3e1c..a00c4e1c375e 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/with_inner_one_of.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/with_inner_one_of.rs @@ -14,7 +14,7 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct WithInnerOneOf { #[serde(rename = "foo", skip_serializing_if = "Option::is_none")] - pub foo: Option>, + pub foo: Option>, } impl WithInnerOneOf { diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/.openapi-generator/FILES b/samples/client/petstore/rust/reqwest/petstore-avoid-box/.openapi-generator/FILES index bbf905beda5c..bb1f8da36d11 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/.openapi-generator/FILES +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/.openapi-generator/FILES @@ -8,7 +8,6 @@ docs/ApiResponse.md docs/ArrayItemRefTest.md docs/Baz.md docs/Category.md -docs/DuplicateOneOf.md docs/DuplicateTest.md docs/Duplicatetest.md docs/EnumArrayTesting.md @@ -34,7 +33,6 @@ docs/User.md docs/UserApi.md docs/Vehicle.md docs/WithInnerOneOf.md -docs/WithInnerOneOfFoo.md git_push.sh src/apis/configuration.rs src/apis/fake_api.rs @@ -51,7 +49,6 @@ src/models/api_response.rs src/models/array_item_ref_test.rs src/models/baz.rs src/models/category.rs -src/models/duplicate_one_of.rs src/models/duplicate_test.rs src/models/duplicatetest.rs src/models/enum_array_testing.rs @@ -72,4 +69,3 @@ src/models/unique_item_array_testing.rs src/models/user.rs src/models/vehicle.rs src/models/with_inner_one_of.rs -src/models/with_inner_one_of_foo.rs 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 3225fb11001f..48fdd05c464e 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/README.md +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/README.md @@ -61,7 +61,6 @@ Class | Method | HTTP request | Description - [ArrayItemRefTest](docs/ArrayItemRefTest.md) - [Baz](docs/Baz.md) - [Category](docs/Category.md) - - [DuplicateOneOf](docs/DuplicateOneOf.md) - [DuplicateTest](docs/DuplicateTest.md) - [Duplicatetest](docs/Duplicatetest.md) - [EnumArrayTesting](docs/EnumArrayTesting.md) @@ -82,7 +81,6 @@ Class | Method | HTTP request | Description - [User](docs/User.md) - [Vehicle](docs/Vehicle.md) - [WithInnerOneOf](docs/WithInnerOneOf.md) - - [WithInnerOneOfFoo](docs/WithInnerOneOfFoo.md) To get access to the crate's generated documentation, use: diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/WithInnerOneOf.md b/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/WithInnerOneOf.md index 5a91d39893fc..93c6ada0387f 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/WithInnerOneOf.md +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/WithInnerOneOf.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**foo** | Option<[**models::WithInnerOneOfFoo**](WithInnerOneOf_foo.md)> | | [optional] +**foo** | Option<[**models::Order**](Order.md)> | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/mod.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/mod.rs index 7a29904ca382..7cdaa063edb5 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/mod.rs +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/mod.rs @@ -10,8 +10,6 @@ pub mod baz; pub use self::baz::Baz; pub mod category; pub use self::category::Category; -pub mod duplicate_one_of; -pub use self::duplicate_one_of::DuplicateOneOf; pub mod duplicate_test; pub use self::duplicate_test::DuplicateTest; pub mod duplicatetest; @@ -52,8 +50,6 @@ pub mod vehicle; pub use self::vehicle::Vehicle; pub mod with_inner_one_of; pub use self::with_inner_one_of::WithInnerOneOf; -pub mod with_inner_one_of_foo; -pub use self::with_inner_one_of_foo::WithInnerOneOfFoo; use serde::{Deserialize, Deserializer, Serializer}; use serde_with::{de::DeserializeAsWrap, ser::SerializeAsWrap, DeserializeAs, SerializeAs}; use std::marker::PhantomData; diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/with_inner_one_of.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/with_inner_one_of.rs index 7afd59a1473a..d866dda95234 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/with_inner_one_of.rs +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/with_inner_one_of.rs @@ -14,7 +14,7 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct WithInnerOneOf { #[serde(rename = "foo", skip_serializing_if = "Option::is_none")] - pub foo: Option, + pub foo: Option, } impl WithInnerOneOf { diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/.openapi-generator/FILES b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/.openapi-generator/FILES index bbf905beda5c..bb1f8da36d11 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/.openapi-generator/FILES +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/.openapi-generator/FILES @@ -8,7 +8,6 @@ docs/ApiResponse.md docs/ArrayItemRefTest.md docs/Baz.md docs/Category.md -docs/DuplicateOneOf.md docs/DuplicateTest.md docs/Duplicatetest.md docs/EnumArrayTesting.md @@ -34,7 +33,6 @@ docs/User.md docs/UserApi.md docs/Vehicle.md docs/WithInnerOneOf.md -docs/WithInnerOneOfFoo.md git_push.sh src/apis/configuration.rs src/apis/fake_api.rs @@ -51,7 +49,6 @@ src/models/api_response.rs src/models/array_item_ref_test.rs src/models/baz.rs src/models/category.rs -src/models/duplicate_one_of.rs src/models/duplicate_test.rs src/models/duplicatetest.rs src/models/enum_array_testing.rs @@ -72,4 +69,3 @@ src/models/unique_item_array_testing.rs src/models/user.rs src/models/vehicle.rs src/models/with_inner_one_of.rs -src/models/with_inner_one_of_foo.rs diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/README.md b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/README.md index d57b543b1729..fb71914ebef3 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/README.md +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/README.md @@ -61,7 +61,6 @@ Class | Method | HTTP request | Description - [ArrayItemRefTest](docs/ArrayItemRefTest.md) - [Baz](docs/Baz.md) - [Category](docs/Category.md) - - [DuplicateOneOf](docs/DuplicateOneOf.md) - [DuplicateTest](docs/DuplicateTest.md) - [Duplicatetest](docs/Duplicatetest.md) - [EnumArrayTesting](docs/EnumArrayTesting.md) @@ -82,7 +81,6 @@ Class | Method | HTTP request | Description - [User](docs/User.md) - [Vehicle](docs/Vehicle.md) - [WithInnerOneOf](docs/WithInnerOneOf.md) - - [WithInnerOneOfFoo](docs/WithInnerOneOfFoo.md) To get access to the crate's generated documentation, use: diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/WithInnerOneOf.md b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/WithInnerOneOf.md index 5a91d39893fc..93c6ada0387f 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/WithInnerOneOf.md +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/WithInnerOneOf.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**foo** | Option<[**models::WithInnerOneOfFoo**](WithInnerOneOf_foo.md)> | | [optional] +**foo** | Option<[**models::Order**](Order.md)> | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/mod.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/mod.rs index 7a29904ca382..7cdaa063edb5 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/mod.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/mod.rs @@ -10,8 +10,6 @@ pub mod baz; pub use self::baz::Baz; pub mod category; pub use self::category::Category; -pub mod duplicate_one_of; -pub use self::duplicate_one_of::DuplicateOneOf; pub mod duplicate_test; pub use self::duplicate_test::DuplicateTest; pub mod duplicatetest; @@ -52,8 +50,6 @@ pub mod vehicle; pub use self::vehicle::Vehicle; pub mod with_inner_one_of; pub use self::with_inner_one_of::WithInnerOneOf; -pub mod with_inner_one_of_foo; -pub use self::with_inner_one_of_foo::WithInnerOneOfFoo; use serde::{Deserialize, Deserializer, Serializer}; use serde_with::{de::DeserializeAsWrap, ser::SerializeAsWrap, DeserializeAs, SerializeAs}; use std::marker::PhantomData; diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/with_inner_one_of.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/with_inner_one_of.rs index 625b96ba3e1c..a00c4e1c375e 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/with_inner_one_of.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/with_inner_one_of.rs @@ -14,7 +14,7 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct WithInnerOneOf { #[serde(rename = "foo", skip_serializing_if = "Option::is_none")] - pub foo: Option>, + pub foo: Option>, } impl WithInnerOneOf { diff --git a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/.openapi-generator/FILES b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/.openapi-generator/FILES index 8f143efb2ca3..abb373467d5a 100644 --- a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/.openapi-generator/FILES +++ b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/.openapi-generator/FILES @@ -9,7 +9,6 @@ docs/FooApiResponse.md docs/FooArrayItemRefTest.md docs/FooBaz.md docs/FooCategory.md -docs/FooDuplicateOneOf.md docs/FooDuplicateTest.md docs/FooDuplicatetest.md docs/FooEnumArrayTesting.md @@ -30,7 +29,6 @@ docs/FooUniqueItemArrayTesting.md docs/FooUser.md docs/FooVehicle.md docs/FooWithInnerOneOf.md -docs/FooWithInnerOneOfFoo.md docs/PetApi.md docs/StoreApi.md docs/TestingApi.md @@ -51,7 +49,6 @@ src/models/foo_api_response.rs src/models/foo_array_item_ref_test.rs src/models/foo_baz.rs src/models/foo_category.rs -src/models/foo_duplicate_one_of.rs src/models/foo_duplicate_test.rs src/models/foo_duplicatetest.rs src/models/foo_enum_array_testing.rs @@ -71,5 +68,4 @@ src/models/foo_unique_item_array_testing.rs src/models/foo_user.rs src/models/foo_vehicle.rs src/models/foo_with_inner_one_of.rs -src/models/foo_with_inner_one_of_foo.rs src/models/mod.rs 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 87918a9c4637..a89804b595f2 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 @@ -61,7 +61,6 @@ Class | Method | HTTP request | Description - [FooArrayItemRefTest](docs/FooArrayItemRefTest.md) - [FooBaz](docs/FooBaz.md) - [FooCategory](docs/FooCategory.md) - - [FooDuplicateOneOf](docs/FooDuplicateOneOf.md) - [FooDuplicateTest](docs/FooDuplicateTest.md) - [FooDuplicatetest](docs/FooDuplicatetest.md) - [FooEnumArrayTesting](docs/FooEnumArrayTesting.md) @@ -82,7 +81,6 @@ Class | Method | HTTP request | Description - [FooUser](docs/FooUser.md) - [FooVehicle](docs/FooVehicle.md) - [FooWithInnerOneOf](docs/FooWithInnerOneOf.md) - - [FooWithInnerOneOfFoo](docs/FooWithInnerOneOfFoo.md) To get access to the crate's generated documentation, use: diff --git a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/FooWithInnerOneOf.md b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/FooWithInnerOneOf.md index 03ca179c709c..00bfa96be53a 100644 --- a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/FooWithInnerOneOf.md +++ b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/FooWithInnerOneOf.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**foo** | Option<[**models::FooWithInnerOneOfFoo**](WithInnerOneOf_foo.md)> | | [optional] +**foo** | Option<[**models::FooOrder**](Order.md)> | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/foo_with_inner_one_of.rs b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/foo_with_inner_one_of.rs index 4c848a833fde..bfb6a694e5b9 100644 --- a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/foo_with_inner_one_of.rs +++ b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/foo_with_inner_one_of.rs @@ -14,7 +14,7 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct FooWithInnerOneOf { #[serde(rename = "foo", skip_serializing_if = "Option::is_none")] - pub foo: Option>, + pub foo: Option>, } impl FooWithInnerOneOf { diff --git a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/mod.rs b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/mod.rs index c871ecdc4221..b08f685662bf 100644 --- a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/mod.rs +++ b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/mod.rs @@ -10,8 +10,6 @@ pub mod foo_baz; pub use self::foo_baz::FooBaz; pub mod foo_category; pub use self::foo_category::FooCategory; -pub mod foo_duplicate_one_of; -pub use self::foo_duplicate_one_of::FooDuplicateOneOf; pub mod foo_duplicate_test; pub use self::foo_duplicate_test::FooDuplicateTest; pub mod foo_duplicatetest; @@ -52,8 +50,6 @@ pub mod foo_vehicle; pub use self::foo_vehicle::FooVehicle; pub mod foo_with_inner_one_of; pub use self::foo_with_inner_one_of::FooWithInnerOneOf; -pub mod foo_with_inner_one_of_foo; -pub use self::foo_with_inner_one_of_foo::FooWithInnerOneOfFoo; use serde::{Deserialize, Deserializer, Serializer}; use serde_with::{de::DeserializeAsWrap, ser::SerializeAsWrap, DeserializeAs, SerializeAs}; use std::marker::PhantomData; diff --git a/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/FILES b/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/FILES index bbf905beda5c..bb1f8da36d11 100644 --- a/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/FILES +++ b/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/FILES @@ -8,7 +8,6 @@ docs/ApiResponse.md docs/ArrayItemRefTest.md docs/Baz.md docs/Category.md -docs/DuplicateOneOf.md docs/DuplicateTest.md docs/Duplicatetest.md docs/EnumArrayTesting.md @@ -34,7 +33,6 @@ docs/User.md docs/UserApi.md docs/Vehicle.md docs/WithInnerOneOf.md -docs/WithInnerOneOfFoo.md git_push.sh src/apis/configuration.rs src/apis/fake_api.rs @@ -51,7 +49,6 @@ src/models/api_response.rs src/models/array_item_ref_test.rs src/models/baz.rs src/models/category.rs -src/models/duplicate_one_of.rs src/models/duplicate_test.rs src/models/duplicatetest.rs src/models/enum_array_testing.rs @@ -72,4 +69,3 @@ src/models/unique_item_array_testing.rs src/models/user.rs src/models/vehicle.rs src/models/with_inner_one_of.rs -src/models/with_inner_one_of_foo.rs diff --git a/samples/client/petstore/rust/reqwest/petstore/README.md b/samples/client/petstore/rust/reqwest/petstore/README.md index 799a40b51908..c9cc16b3075a 100644 --- a/samples/client/petstore/rust/reqwest/petstore/README.md +++ b/samples/client/petstore/rust/reqwest/petstore/README.md @@ -61,7 +61,6 @@ Class | Method | HTTP request | Description - [ArrayItemRefTest](docs/ArrayItemRefTest.md) - [Baz](docs/Baz.md) - [Category](docs/Category.md) - - [DuplicateOneOf](docs/DuplicateOneOf.md) - [DuplicateTest](docs/DuplicateTest.md) - [Duplicatetest](docs/Duplicatetest.md) - [EnumArrayTesting](docs/EnumArrayTesting.md) @@ -82,7 +81,6 @@ Class | Method | HTTP request | Description - [User](docs/User.md) - [Vehicle](docs/Vehicle.md) - [WithInnerOneOf](docs/WithInnerOneOf.md) - - [WithInnerOneOfFoo](docs/WithInnerOneOfFoo.md) To get access to the crate's generated documentation, use: diff --git a/samples/client/petstore/rust/reqwest/petstore/docs/WithInnerOneOf.md b/samples/client/petstore/rust/reqwest/petstore/docs/WithInnerOneOf.md index 5a91d39893fc..93c6ada0387f 100644 --- a/samples/client/petstore/rust/reqwest/petstore/docs/WithInnerOneOf.md +++ b/samples/client/petstore/rust/reqwest/petstore/docs/WithInnerOneOf.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**foo** | Option<[**models::WithInnerOneOfFoo**](WithInnerOneOf_foo.md)> | | [optional] +**foo** | Option<[**models::Order**](Order.md)> | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/mod.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/mod.rs index 7a29904ca382..7cdaa063edb5 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/mod.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/mod.rs @@ -10,8 +10,6 @@ pub mod baz; pub use self::baz::Baz; pub mod category; pub use self::category::Category; -pub mod duplicate_one_of; -pub use self::duplicate_one_of::DuplicateOneOf; pub mod duplicate_test; pub use self::duplicate_test::DuplicateTest; pub mod duplicatetest; @@ -52,8 +50,6 @@ pub mod vehicle; pub use self::vehicle::Vehicle; pub mod with_inner_one_of; pub use self::with_inner_one_of::WithInnerOneOf; -pub mod with_inner_one_of_foo; -pub use self::with_inner_one_of_foo::WithInnerOneOfFoo; use serde::{Deserialize, Deserializer, Serializer}; use serde_with::{de::DeserializeAsWrap, ser::SerializeAsWrap, DeserializeAs, SerializeAs}; use std::marker::PhantomData; diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/with_inner_one_of.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/with_inner_one_of.rs index 625b96ba3e1c..a00c4e1c375e 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/with_inner_one_of.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/with_inner_one_of.rs @@ -14,7 +14,7 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct WithInnerOneOf { #[serde(rename = "foo", skip_serializing_if = "Option::is_none")] - pub foo: Option>, + pub foo: Option>, } impl WithInnerOneOf {