diff --git a/bin/configs/rust-hyper-test-duplicates.yaml b/bin/configs/rust-hyper-test-duplicates.yaml new file mode 100644 index 000000000000..4937733fb859 --- /dev/null +++ b/bin/configs/rust-hyper-test-duplicates.yaml @@ -0,0 +1,10 @@ +generatorName: rust +outputDir: samples/client/petstore/rust/hyper/test-duplicates +library: hyper +inputSpec: modules/openapi-generator/src/test/resources/3_0/rust/test_duplicates.yaml +templateDir: modules/openapi-generator/src/main/resources/rust +additionalProperties: + supportAsync: "false" + packageName: test-duplicates-hyper +modelNameMappings: + Duplicatetest: another_test diff --git a/bin/configs/rust-reqwest-test-duplicates.yaml b/bin/configs/rust-reqwest-test-duplicates.yaml new file mode 100644 index 000000000000..71b9ef964d8e --- /dev/null +++ b/bin/configs/rust-reqwest-test-duplicates.yaml @@ -0,0 +1,12 @@ +generatorName: rust +outputDir: samples/client/petstore/rust/reqwest/test-duplicates +library: reqwest +inputSpec: modules/openapi-generator/src/test/resources/3_0/rust/test_duplicates.yaml +templateDir: modules/openapi-generator/src/main/resources/rust +additionalProperties: + supportAsync: false + packageName: test-duplicates-reqwest +enumNameMappings: + delivered: shipped +modelNameMappings: + Duplicatetest: another_test diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRustCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRustCodegen.java index 271fecf0df4b..4d32067a79e4 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRustCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRustCodegen.java @@ -346,6 +346,10 @@ protected String addModelNamePrefixAndSuffix(String name) { @Override public String toModelName(String name) { + if (modelNameMapping.containsKey(name)) { + return modelNameMapping.get(name); + } + return sanitizeIdentifier(addModelNamePrefixAndSuffix(name), CasingType.CAMEL_CASE, "model", "model", false); } 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 6c658424a178..37c5b4e1e6c0 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 @@ -699,26 +699,6 @@ paths: application/json: schema: $ref: '#/components/schemas/TypeTesting' - '/tests/discriminatorDuplicateEnums': - get: - tags: - - testing - summary: 'Test for duplicate enums when using discriminator. (One of the issues in #20500)' - responses: - '200': - description: test - content: - application/json: - schema: - anyOf: - - $ref: '#/components/schemas/Person' - - $ref: '#/components/schemas/Vehicle' - discriminator: - propertyName: objectType - mapping: - student: '#/components/schemas/Person' - teacher: '#/components/schemas/Person' - car: '#/components/schemas/Vehicle' '/tests/allOfWithOneModel': get: tags: @@ -1121,16 +1101,6 @@ components: required: - type - speed - DuplicateTest: - type: object - properties: - name: - type: string - Duplicatetest: # explicitly testing the same name with different casing - type: object - properties: - name: - type: string existing_tags_array: type: array items: @@ -1150,11 +1120,6 @@ 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: diff --git a/modules/openapi-generator/src/test/resources/3_0/rust/test_duplicates.yaml b/modules/openapi-generator/src/test/resources/3_0/rust/test_duplicates.yaml new file mode 100644 index 000000000000..fd1b4b762cbc --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/rust/test_duplicates.yaml @@ -0,0 +1,78 @@ +openapi: 3.0.0 +servers: + - url: 'http://petstore.swagger.io/v2' +info: + description: To test duplicates + version: 1.0.0 + title: OpenAPI Petstore + license: + name: Apache-2.0 + url: 'https://www.apache.org/licenses/LICENSE-2.0.html' +tags: + - name: pet + description: Everything about your Pets + - name: store + description: Access to Petstore orders + - name: user + description: Operations about user +paths: + '/tests/discriminatorDuplicateEnums': + get: + tags: + - testing + summary: 'Test for duplicate enums when using discriminator. (One of the issues in #20500)' + responses: + '200': + description: test + content: + application/json: + schema: + anyOf: + - $ref: '#/components/schemas/Person' + - $ref: '#/components/schemas/Vehicle' + discriminator: + propertyName: objectType + mapping: + student: '#/components/schemas/Person' + teacher: '#/components/schemas/Person' + car: '#/components/schemas/Vehicle' +externalDocs: + description: Find out more about Swagger + url: 'http://swagger.io' +components: + schemas: + DuplicateTest: + type: object + properties: + name: + type: string + Duplicatetest: # explicitly testing the same name with different casing + type: object + properties: + name: + type: string + DuplicateOneOf: + type: object + oneOf: + - $ref: '#/components/schemas/Person' + - $ref: '#/components/schemas/Person' + Person: + type: object + properties: + type: + type: string + name: + type: string + required: + - type + - name + Vehicle: + type: object + properties: + type: + type: string + speed: + type: number + required: + - type + - speed diff --git a/samples/client/petstore/rust/hyper/petstore/.openapi-generator/FILES b/samples/client/petstore/rust/hyper/petstore/.openapi-generator/FILES index 9b85cc92014c..45d9997b4068 100644 --- a/samples/client/petstore/rust/hyper/petstore/.openapi-generator/FILES +++ b/samples/client/petstore/rust/hyper/petstore/.openapi-generator/FILES @@ -8,8 +8,6 @@ docs/ApiResponse.md docs/ArrayItemRefTest.md docs/Baz.md docs/Category.md -docs/DuplicateTest.md -docs/Duplicatetest.md docs/EnumArrayTesting.md docs/FakeApi.md docs/NullableArray.md @@ -27,7 +25,6 @@ docs/StoreApi.md docs/Tag.md docs/TestAllOfWithMultiMetadataOnly.md docs/TestingApi.md -docs/TestsDiscriminatorDuplicateEnumsGet200Response.md docs/TypeTesting.md docs/UniqueItemArrayTesting.md docs/User.md @@ -45,15 +42,12 @@ src/apis/store_api.rs src/apis/testing_api.rs src/apis/user_api.rs src/lib.rs -src/models/_tests_discriminator_duplicate_enums_get_200_response.rs src/models/action_container.rs src/models/any_type_test.rs src/models/api_response.rs src/models/array_item_ref_test.rs src/models/baz.rs src/models/category.rs -src/models/duplicate_test.rs -src/models/duplicatetest.rs src/models/enum_array_testing.rs src/models/mod.rs src/models/model_ref.rs diff --git a/samples/client/petstore/rust/hyper/petstore/README.md b/samples/client/petstore/rust/hyper/petstore/README.md index e9484f587b13..6111f6de7503 100644 --- a/samples/client/petstore/rust/hyper/petstore/README.md +++ b/samples/client/petstore/rust/hyper/petstore/README.md @@ -42,7 +42,6 @@ Class | Method | HTTP request | Description *StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **Get** /store/order/{orderId} | Find purchase order by ID *StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **Post** /store/order | Place an order for a pet *TestingApi* | [**tests_all_of_with_one_model_get**](docs/TestingApi.md#tests_all_of_with_one_model_get) | **Get** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) -*TestingApi* | [**tests_discriminator_duplicate_enums_get**](docs/TestingApi.md#tests_discriminator_duplicate_enums_get) | **Get** /tests/discriminatorDuplicateEnums | Test for duplicate enums when using discriminator. (One of the issues in #20500) *TestingApi* | [**tests_file_response_get**](docs/TestingApi.md#tests_file_response_get) | **Get** /tests/fileResponse | Returns an image file *TestingApi* | [**tests_type_testing_get**](docs/TestingApi.md#tests_type_testing_get) | **Get** /tests/typeTesting | Route to test the TypeTesting schema *UserApi* | [**create_user**](docs/UserApi.md#create_user) | **Post** /user | Create user @@ -63,8 +62,6 @@ Class | Method | HTTP request | Description - [ArrayItemRefTest](docs/ArrayItemRefTest.md) - [Baz](docs/Baz.md) - [Category](docs/Category.md) - - [DuplicateTest](docs/DuplicateTest.md) - - [Duplicatetest](docs/Duplicatetest.md) - [EnumArrayTesting](docs/EnumArrayTesting.md) - [NullableArray](docs/NullableArray.md) - [NumericEnumTesting](docs/NumericEnumTesting.md) @@ -78,7 +75,6 @@ Class | Method | HTTP request | Description - [Return](docs/Return.md) - [Tag](docs/Tag.md) - [TestAllOfWithMultiMetadataOnly](docs/TestAllOfWithMultiMetadataOnly.md) - - [TestsDiscriminatorDuplicateEnumsGet200Response](docs/TestsDiscriminatorDuplicateEnumsGet200Response.md) - [TypeTesting](docs/TypeTesting.md) - [UniqueItemArrayTesting](docs/UniqueItemArrayTesting.md) - [User](docs/User.md) diff --git a/samples/client/petstore/rust/hyper/petstore/docs/DefaultApi.md b/samples/client/petstore/rust/hyper/petstore/docs/DefaultApi.md deleted file mode 100644 index 54af22952577..000000000000 --- a/samples/client/petstore/rust/hyper/petstore/docs/DefaultApi.md +++ /dev/null @@ -1,60 +0,0 @@ -# \DefaultApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**tests_file_response_get**](DefaultApi.md#tests_file_response_get) | **Get** /tests/fileResponse | Returns an image file -[**tests_type_testing_get**](DefaultApi.md#tests_type_testing_get) | **Get** /tests/typeTesting | Route to test the TypeTesting schema - - - -## tests_file_response_get - -> std::path::PathBuf tests_file_response_get() -Returns an image file - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**std::path::PathBuf**](std::path::PathBuf.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: image/jpeg - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## tests_type_testing_get - -> crate::models::TypeTesting tests_type_testing_get() -Route to test the TypeTesting schema - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**crate::models::TypeTesting**](TypeTesting.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/rust/hyper/petstore/docs/DuplicateOneOf.md b/samples/client/petstore/rust/hyper/petstore/docs/DuplicateOneOf.md deleted file mode 100644 index 22b6b00f001b..000000000000 --- a/samples/client/petstore/rust/hyper/petstore/docs/DuplicateOneOf.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/PetsExplodePostPageExplodeParameter.md b/samples/client/petstore/rust/hyper/petstore/docs/PetsExplodePostPageExplodeParameter.md deleted file mode 100644 index 4d328f64458c..000000000000 --- a/samples/client/petstore/rust/hyper/petstore/docs/PetsExplodePostPageExplodeParameter.md +++ /dev/null @@ -1,12 +0,0 @@ -# PetsExplodePostPageExplodeParameter - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**size** | Option<**i64**> | The page size. | [optional][default to 10] -**number** | Option<**i64**> | The page number. | [optional][default to 1] - -[[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/PetsExplodePostPageParameter.md b/samples/client/petstore/rust/hyper/petstore/docs/PetsExplodePostPageParameter.md deleted file mode 100644 index feef5fcabd79..000000000000 --- a/samples/client/petstore/rust/hyper/petstore/docs/PetsExplodePostPageParameter.md +++ /dev/null @@ -1,12 +0,0 @@ -# PetsExplodePostPageParameter - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**size** | Option<**i64**> | The page size. | [optional][default to 10] -**number** | Option<**i64**> | The page number. | [optional][default to 1] - -[[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/TestingApi.md b/samples/client/petstore/rust/hyper/petstore/docs/TestingApi.md index bec230290b7c..a4009e0d40a2 100644 --- a/samples/client/petstore/rust/hyper/petstore/docs/TestingApi.md +++ b/samples/client/petstore/rust/hyper/petstore/docs/TestingApi.md @@ -5,7 +5,6 @@ All URIs are relative to *http://petstore.swagger.io/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**tests_all_of_with_one_model_get**](TestingApi.md#tests_all_of_with_one_model_get) | **Get** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) -[**tests_discriminator_duplicate_enums_get**](TestingApi.md#tests_discriminator_duplicate_enums_get) | **Get** /tests/discriminatorDuplicateEnums | Test for duplicate enums when using discriminator. (One of the issues in #20500) [**tests_file_response_get**](TestingApi.md#tests_file_response_get) | **Get** /tests/fileResponse | Returns an image file [**tests_type_testing_get**](TestingApi.md#tests_type_testing_get) | **Get** /tests/typeTesting | Route to test the TypeTesting schema @@ -39,31 +38,6 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## tests_discriminator_duplicate_enums_get - -> models::TestsDiscriminatorDuplicateEnumsGet200Response tests_discriminator_duplicate_enums_get() -Test for duplicate enums when using discriminator. (One of the issues in #20500) - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::TestsDiscriminatorDuplicateEnumsGet200Response**](_tests_discriminatorDuplicateEnums_get_200_response.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - ## tests_file_response_get > std::path::PathBuf tests_file_response_get() diff --git a/samples/client/petstore/rust/hyper/petstore/docs/WithInnerOneOfFoo.md b/samples/client/petstore/rust/hyper/petstore/docs/WithInnerOneOfFoo.md deleted file mode 100644 index fcf524123aca..000000000000 --- a/samples/client/petstore/rust/hyper/petstore/docs/WithInnerOneOfFoo.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/apis/testing_api.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/testing_api.rs index 1e16186bd200..fee7996eb2d3 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/apis/testing_api.rs @@ -38,7 +38,6 @@ impl TestingApiClient pub trait TestingApi: Send + Sync { fn tests_all_of_with_one_model_get(&self, person: models::Person) -> Pin> + Send>>; - fn tests_discriminator_duplicate_enums_get(&self, ) -> Pin> + Send>>; fn tests_file_response_get(&self, ) -> Pin> + Send>>; fn tests_type_testing_get(&self, ) -> Pin> + Send>>; } @@ -54,14 +53,6 @@ implTestingApi for TestingApiClient req.execute(self.configuration.borrow()) } - #[allow(unused_mut)] - fn tests_discriminator_duplicate_enums_get(&self, ) -> Pin> + Send>> { - let mut req = __internal_request::Request::new(hyper::Method::GET, "/tests/discriminatorDuplicateEnums".to_string()) - ; - - req.execute(self.configuration.borrow()) - } - #[allow(unused_mut)] fn tests_file_response_get(&self, ) -> Pin> + Send>> { let mut req = __internal_request::Request::new(hyper::Method::GET, "/tests/fileResponse".to_string()) diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/_pets_explode_post_page_explode_parameter.rs b/samples/client/petstore/rust/hyper/petstore/src/models/_pets_explode_post_page_explode_parameter.rs deleted file mode 100644 index 39367534b60b..000000000000 --- a/samples/client/petstore/rust/hyper/petstore/src/models/_pets_explode_post_page_explode_parameter.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 PetsExplodePostPageExplodeParameter { - /// The page size. - #[serde(rename = "size", skip_serializing_if = "Option::is_none")] - pub size: Option, - /// The page number. - #[serde(rename = "number", skip_serializing_if = "Option::is_none")] - pub number: Option, -} - -impl PetsExplodePostPageExplodeParameter { - pub fn new() -> PetsExplodePostPageExplodeParameter { - PetsExplodePostPageExplodeParameter { - size: None, - number: None, - } - } -} - diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/_pets_explode_post_page_parameter.rs b/samples/client/petstore/rust/hyper/petstore/src/models/_pets_explode_post_page_parameter.rs deleted file mode 100644 index 6a9d3bd2797d..000000000000 --- a/samples/client/petstore/rust/hyper/petstore/src/models/_pets_explode_post_page_parameter.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 PetsExplodePostPageParameter { - /// The page size. - #[serde(rename = "size", skip_serializing_if = "Option::is_none")] - pub size: Option, - /// The page number. - #[serde(rename = "number", skip_serializing_if = "Option::is_none")] - pub number: Option, -} - -impl PetsExplodePostPageParameter { - pub fn new() -> PetsExplodePostPageParameter { - PetsExplodePostPageParameter { - size: None, - number: None, - } - } -} - diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/_tests_discriminator_duplicate_enums_get_200_response.rs b/samples/client/petstore/rust/hyper/petstore/src/models/_tests_discriminator_duplicate_enums_get_200_response.rs deleted file mode 100644 index 5f7776745949..000000000000 --- a/samples/client/petstore/rust/hyper/petstore/src/models/_tests_discriminator_duplicate_enums_get_200_response.rs +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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(tag = "objectType")] -pub enum TestsDiscriminatorDuplicateEnumsGet200Response { - #[serde(rename="car")] - Vehicle { - #[serde(rename = "type")] - r#type: String, - #[serde(rename = "name")] - name: String, - #[serde(rename = "speed")] - speed: f64, - }, - #[serde(rename="student")] - PersonStudent { - #[serde(rename = "type")] - r#type: String, - #[serde(rename = "name")] - name: String, - #[serde(rename = "speed")] - speed: f64, - }, - #[serde(rename="teacher")] - PersonTeacher { - #[serde(rename = "type")] - r#type: String, - #[serde(rename = "name")] - name: String, - #[serde(rename = "speed")] - speed: f64, - }, -} - -impl Default for TestsDiscriminatorDuplicateEnumsGet200Response { - fn default() -> Self { - Self::Vehicle { - r#type: Default::default(), - name: Default::default(), - speed: Default::default(), - } - - } -} - - 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 deleted file mode 100644 index e1039b65bcf7..000000000000 --- a/samples/client/petstore/rust/hyper/petstore/src/models/duplicate_one_of.rs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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/duplicate_test.rs b/samples/client/petstore/rust/hyper/petstore/src/models/duplicate_test.rs deleted file mode 100644 index a27e36772fc6..000000000000 --- a/samples/client/petstore/rust/hyper/petstore/src/models/duplicate_test.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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 DuplicateTest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, -} - -impl DuplicateTest { - pub fn new() -> DuplicateTest { - DuplicateTest { - name: None, - } - } -} - diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/duplicatetest.rs b/samples/client/petstore/rust/hyper/petstore/src/models/duplicatetest.rs deleted file mode 100644 index f50f7b84ecbe..000000000000 --- a/samples/client/petstore/rust/hyper/petstore/src/models/duplicatetest.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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 Duplicatetest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, -} - -impl Duplicatetest { - pub fn new() -> Duplicatetest { - Duplicatetest { - name: None, - } - } -} - 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 653d185cd8d7..277e6f130a45 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/mod.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/mod.rs @@ -10,10 +10,6 @@ pub mod baz; pub use self::baz::Baz; pub mod category; pub use self::category::Category; -pub mod duplicate_test; -pub use self::duplicate_test::DuplicateTest; -pub mod duplicatetest; -pub use self::duplicatetest::Duplicatetest; pub mod enum_array_testing; pub use self::enum_array_testing::EnumArrayTesting; pub mod nullable_array; @@ -40,8 +36,6 @@ pub mod tag; pub use self::tag::Tag; pub mod test_all_of_with_multi_metadata_only; pub use self::test_all_of_with_multi_metadata_only::TestAllOfWithMultiMetadataOnly; -pub mod _tests_discriminator_duplicate_enums_get_200_response; -pub use self::_tests_discriminator_duplicate_enums_get_200_response::TestsDiscriminatorDuplicateEnumsGet200Response; pub mod type_testing; pub use self::type_testing::TypeTesting; pub mod unique_item_array_testing; 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 deleted file mode 100644 index 26ed4ce5f116..000000000000 --- a/samples/client/petstore/rust/hyper/petstore/src/models/with_inner_one_of_foo.rs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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/hyper/test-duplicates/.gitignore b/samples/client/petstore/rust/hyper/test-duplicates/.gitignore new file mode 100644 index 000000000000..6aa106405a4b --- /dev/null +++ b/samples/client/petstore/rust/hyper/test-duplicates/.gitignore @@ -0,0 +1,3 @@ +/target/ +**/*.rs.bk +Cargo.lock diff --git a/samples/client/petstore/rust/hyper/test-duplicates/.openapi-generator-ignore b/samples/client/petstore/rust/hyper/test-duplicates/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/petstore/rust/hyper/test-duplicates/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/rust/hyper/test-duplicates/.openapi-generator/FILES b/samples/client/petstore/rust/hyper/test-duplicates/.openapi-generator/FILES new file mode 100644 index 000000000000..25f5d3c3ecfb --- /dev/null +++ b/samples/client/petstore/rust/hyper/test-duplicates/.openapi-generator/FILES @@ -0,0 +1,23 @@ +.gitignore +.travis.yml +Cargo.toml +README.md +docs/DuplicateTest.md +docs/Person.md +docs/TestingApi.md +docs/TestsDiscriminatorDuplicateEnumsGet200Response.md +docs/Vehicle.md +docs/another_test.md +git_push.sh +src/apis/client.rs +src/apis/configuration.rs +src/apis/mod.rs +src/apis/request.rs +src/apis/testing_api.rs +src/lib.rs +src/models/_tests_discriminator_duplicate_enums_get_200_response.rs +src/models/duplicate_test.rs +src/models/duplicatetest.rs +src/models/mod.rs +src/models/person.rs +src/models/vehicle.rs diff --git a/samples/client/petstore/rust/hyper/test-duplicates/.openapi-generator/VERSION b/samples/client/petstore/rust/hyper/test-duplicates/.openapi-generator/VERSION new file mode 100644 index 000000000000..4c631cf217a2 --- /dev/null +++ b/samples/client/petstore/rust/hyper/test-duplicates/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.14.0-SNAPSHOT diff --git a/samples/client/petstore/rust/hyper/test-duplicates/.travis.yml b/samples/client/petstore/rust/hyper/test-duplicates/.travis.yml new file mode 100644 index 000000000000..22761ba7ee19 --- /dev/null +++ b/samples/client/petstore/rust/hyper/test-duplicates/.travis.yml @@ -0,0 +1 @@ +language: rust diff --git a/samples/client/petstore/rust/hyper/test-duplicates/Cargo.toml b/samples/client/petstore/rust/hyper/test-duplicates/Cargo.toml new file mode 100644 index 000000000000..a5ab728c3774 --- /dev/null +++ b/samples/client/petstore/rust/hyper/test-duplicates/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "test-duplicates-hyper" +version = "1.0.0" +authors = ["OpenAPI Generator team and contributors"] +description = "To test duplicates" +license = "Apache-2.0" +edition = "2021" + +[dependencies] +serde = { version = "^1.0", features = ["derive"] } +serde_json = "^1.0" +serde_repr = "^0.1" +url = "^2.5" +hyper = { version = "^1.3.1", features = ["full"] } +hyper-util = { version = "0.1.5", features = ["client", "client-legacy", "http1", "http2"] } +http-body-util = { version = "0.1.2" } +http = "~0.2" +base64 = "~0.7.0" +futures = "^0.3" diff --git a/samples/client/petstore/rust/hyper/test-duplicates/README.md b/samples/client/petstore/rust/hyper/test-duplicates/README.md new file mode 100644 index 000000000000..70c192c1e1a3 --- /dev/null +++ b/samples/client/petstore/rust/hyper/test-duplicates/README.md @@ -0,0 +1,50 @@ +# Rust API client for test-duplicates-hyper + +To test duplicates + + +## Overview + +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: 1.0.0 +- Generator version: 7.14.0-SNAPSHOT +- Build package: `org.openapitools.codegen.languages.RustClientCodegen` + +## Installation + +Put the package under your project folder in a directory named `test-duplicates-hyper` and add the following to `Cargo.toml` under `[dependencies]`: + +``` +test-duplicates-hyper = { path = "./test-duplicates-hyper" } +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*TestingApi* | [**tests_discriminator_duplicate_enums_get**](docs/TestingApi.md#tests_discriminator_duplicate_enums_get) | **Get** /tests/discriminatorDuplicateEnums | Test for duplicate enums when using discriminator. (One of the issues in #20500) + + +## Documentation For Models + + - [DuplicateTest](docs/DuplicateTest.md) + - [Person](docs/Person.md) + - [TestsDiscriminatorDuplicateEnumsGet200Response](docs/TestsDiscriminatorDuplicateEnumsGet200Response.md) + - [Vehicle](docs/Vehicle.md) + - [another_test](docs/another_test.md) + + +To get access to the crate's generated documentation, use: + +``` +cargo doc --open +``` + +## Author + + + diff --git a/samples/client/petstore/rust/hyper/petstore/docs/DuplicateTest.md b/samples/client/petstore/rust/hyper/test-duplicates/docs/DuplicateTest.md similarity index 100% rename from samples/client/petstore/rust/hyper/petstore/docs/DuplicateTest.md rename to samples/client/petstore/rust/hyper/test-duplicates/docs/DuplicateTest.md diff --git a/samples/client/petstore/rust/hyper/test-duplicates/docs/Person.md b/samples/client/petstore/rust/hyper/test-duplicates/docs/Person.md new file mode 100644 index 000000000000..20b43cc0345e --- /dev/null +++ b/samples/client/petstore/rust/hyper/test-duplicates/docs/Person.md @@ -0,0 +1,12 @@ +# Person + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | **String** | | +**name** | **String** | | + +[[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/test-duplicates/docs/TestingApi.md b/samples/client/petstore/rust/hyper/test-duplicates/docs/TestingApi.md new file mode 100644 index 000000000000..aaea51534093 --- /dev/null +++ b/samples/client/petstore/rust/hyper/test-duplicates/docs/TestingApi.md @@ -0,0 +1,34 @@ +# \TestingApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**tests_discriminator_duplicate_enums_get**](TestingApi.md#tests_discriminator_duplicate_enums_get) | **Get** /tests/discriminatorDuplicateEnums | Test for duplicate enums when using discriminator. (One of the issues in #20500) + + + +## tests_discriminator_duplicate_enums_get + +> models::TestsDiscriminatorDuplicateEnumsGet200Response tests_discriminator_duplicate_enums_get() +Test for duplicate enums when using discriminator. (One of the issues in #20500) + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**models::TestsDiscriminatorDuplicateEnumsGet200Response**](_tests_discriminatorDuplicateEnums_get_200_response.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/rust/hyper/petstore/docs/TestsDiscriminatorDuplicateEnumsGet200Response.md b/samples/client/petstore/rust/hyper/test-duplicates/docs/TestsDiscriminatorDuplicateEnumsGet200Response.md similarity index 100% rename from samples/client/petstore/rust/hyper/petstore/docs/TestsDiscriminatorDuplicateEnumsGet200Response.md rename to samples/client/petstore/rust/hyper/test-duplicates/docs/TestsDiscriminatorDuplicateEnumsGet200Response.md diff --git a/samples/client/petstore/rust/hyper/petstore/docs/Duplicatetest.md b/samples/client/petstore/rust/hyper/test-duplicates/docs/Vehicle.md similarity index 80% rename from samples/client/petstore/rust/hyper/petstore/docs/Duplicatetest.md rename to samples/client/petstore/rust/hyper/test-duplicates/docs/Vehicle.md index dab029dbf559..1a4b48467fd6 100644 --- a/samples/client/petstore/rust/hyper/petstore/docs/Duplicatetest.md +++ b/samples/client/petstore/rust/hyper/test-duplicates/docs/Vehicle.md @@ -1,10 +1,11 @@ -# Duplicatetest +# Vehicle ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | Option<**String**> | | [optional] +**r#type** | **String** | | +**speed** | **f64** | | [[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/DuplicateTest.md b/samples/client/petstore/rust/hyper/test-duplicates/docs/another_test.md similarity index 95% rename from samples/client/petstore/rust/reqwest-trait/petstore/docs/DuplicateTest.md rename to samples/client/petstore/rust/hyper/test-duplicates/docs/another_test.md index b9dd67677d29..835bbb03ab5e 100644 --- a/samples/client/petstore/rust/reqwest-trait/petstore/docs/DuplicateTest.md +++ b/samples/client/petstore/rust/hyper/test-duplicates/docs/another_test.md @@ -1,4 +1,4 @@ -# DuplicateTest +# another_test ## Properties diff --git a/samples/client/petstore/rust/hyper/test-duplicates/git_push.sh b/samples/client/petstore/rust/hyper/test-duplicates/git_push.sh new file mode 100644 index 000000000000..f53a75d4fabe --- /dev/null +++ b/samples/client/petstore/rust/hyper/test-duplicates/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/rust/hyper/test-duplicates/src/apis/client.rs b/samples/client/petstore/rust/hyper/test-duplicates/src/apis/client.rs new file mode 100644 index 000000000000..15aa68660c44 --- /dev/null +++ b/samples/client/petstore/rust/hyper/test-duplicates/src/apis/client.rs @@ -0,0 +1,25 @@ +use std::sync::Arc; + +use hyper; +use hyper_util::client::legacy::connect::Connect; +use super::configuration::Configuration; + +pub struct APIClient { + testing_api: Box, +} + +impl APIClient { + pub fn new(configuration: Configuration) -> APIClient + where C: Clone + std::marker::Send + Sync + 'static { + let rc = Arc::new(configuration); + + APIClient { + testing_api: Box::new(crate::apis::TestingApiClient::new(rc.clone())), + } + } + + pub fn testing_api(&self) -> &dyn crate::apis::TestingApi{ + self.testing_api.as_ref() + } + +} diff --git a/samples/client/petstore/rust/hyper/test-duplicates/src/apis/configuration.rs b/samples/client/petstore/rust/hyper/test-duplicates/src/apis/configuration.rs new file mode 100644 index 000000000000..65c720560599 --- /dev/null +++ b/samples/client/petstore/rust/hyper/test-duplicates/src/apis/configuration.rs @@ -0,0 +1,92 @@ +/* + * OpenAPI Petstore + * + * To test duplicates + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use hyper; +use hyper_util::client::legacy::Client; +use hyper_util::client::legacy::connect::Connect; +use hyper_util::client::legacy::connect::HttpConnector; +use hyper_util::rt::TokioExecutor; + +pub struct Configuration + where C: Clone + std::marker::Send + Sync + 'static { + pub base_path: String, + pub user_agent: Option, + pub client: Client, + pub basic_auth: Option, + pub oauth_access_token: Option, + pub api_key: Option, + // TODO: take an oauth2 token source, similar to the go one +} + +pub type BasicAuth = (String, Option); + +pub struct ApiKey { + pub prefix: Option, + pub key: String, +} + +impl Configuration { + /// Construct a default [`Configuration`](Self) with a hyper client using a default + /// [`HttpConnector`](hyper_util::client::legacy::connect::HttpConnector). + /// + /// Use [`with_client`](Configuration::with_client) to construct a Configuration with a + /// custom hyper client. + /// + /// # Example + /// + /// ``` + /// # use test_duplicates_hyper::apis::configuration::Configuration; + /// let api_config = Configuration { + /// basic_auth: Some(("user".into(), None)), + /// ..Configuration::new() + /// }; + /// ``` + pub fn new() -> Configuration { + Configuration::default() + } +} + +impl Configuration + where C: Clone + std::marker::Send + Sync { + + /// Construct a new Configuration with a custom hyper client. + /// + /// # Example + /// + /// ``` + /// # use core::time::Duration; + /// # use test_duplicates_hyper::apis::configuration::Configuration; + /// use hyper_util::client::legacy::Client; + /// use hyper_util::rt::TokioExecutor; + /// + /// let client = Client::builder(TokioExecutor::new()) + /// .pool_idle_timeout(Duration::from_secs(30)) + /// .build_http(); + /// + /// let api_config = Configuration::with_client(client); + /// ``` + pub fn with_client(client: Client) -> Configuration { + Configuration { + base_path: "http://petstore.swagger.io/v2".to_owned(), + user_agent: Some("OpenAPI-Generator/1.0.0/rust".to_owned()), + client, + basic_auth: None, + oauth_access_token: None, + api_key: None, + } + } +} + +impl Default for Configuration { + fn default() -> Self { + let client = Client::builder(TokioExecutor::new()).build_http(); + Configuration::with_client(client) + } +} diff --git a/samples/client/petstore/rust/hyper/test-duplicates/src/apis/mod.rs b/samples/client/petstore/rust/hyper/test-duplicates/src/apis/mod.rs new file mode 100644 index 000000000000..f8a1a2913cd2 --- /dev/null +++ b/samples/client/petstore/rust/hyper/test-duplicates/src/apis/mod.rs @@ -0,0 +1,73 @@ +use std::fmt; +use std::fmt::Debug; + +use hyper; +use hyper::http; +use hyper_util::client::legacy::connect::Connect; +use serde_json; + +#[derive(Debug)] +pub enum Error { + Api(ApiError), + Header(http::header::InvalidHeaderValue), + Http(http::Error), + Hyper(hyper::Error), + HyperClient(hyper_util::client::legacy::Error), + Serde(serde_json::Error), + UriError(http::uri::InvalidUri), +} + +pub struct ApiError { + pub code: hyper::StatusCode, + pub body: hyper::body::Incoming, +} + +impl Debug for ApiError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("ApiError") + .field("code", &self.code) + .field("body", &"hyper::body::Incoming") + .finish() + } +} + +impl From<(hyper::StatusCode, hyper::body::Incoming)> for Error { + fn from(e: (hyper::StatusCode, hyper::body::Incoming)) -> Self { + Error::Api(ApiError { + code: e.0, + body: e.1, + }) + } +} + +impl From for Error { + fn from(e: http::Error) -> Self { + Error::Http(e) + } +} + +impl From for Error { + fn from(e: hyper_util::client::legacy::Error) -> Self { + Error::HyperClient(e) + } +} + +impl From for Error { + fn from(e: hyper::Error) -> Self { + Error::Hyper(e) + } +} + +impl From for Error { + fn from(e: serde_json::Error) -> Self { + Error::Serde(e) + } +} + +mod request; + +mod testing_api; +pub use self::testing_api::{ TestingApi, TestingApiClient }; + +pub mod configuration; +pub mod client; diff --git a/samples/client/petstore/rust/hyper/test-duplicates/src/apis/request.rs b/samples/client/petstore/rust/hyper/test-duplicates/src/apis/request.rs new file mode 100644 index 000000000000..a6f7b74cc6ef --- /dev/null +++ b/samples/client/petstore/rust/hyper/test-duplicates/src/apis/request.rs @@ -0,0 +1,247 @@ +use std::collections::HashMap; +use std::pin::Pin; + +use futures; +use futures::Future; +use futures::future::*; +use http_body_util::BodyExt; +use hyper; +use hyper_util::client::legacy::connect::Connect; +use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, HeaderValue, USER_AGENT}; +use serde; +use serde_json; + +use super::{configuration, Error}; + +pub(crate) struct ApiKey { + pub in_header: bool, + pub in_query: bool, + pub param_name: String, +} + +impl ApiKey { + fn key(&self, prefix: &Option, key: &str) -> String { + match prefix { + None => key.to_owned(), + Some(ref prefix) => format!("{} {}", prefix, key), + } + } +} + +#[allow(dead_code)] +pub(crate) enum Auth { + None, + ApiKey(ApiKey), + Basic, + Oauth, +} + +/// If the authorization type is unspecified then it will be automatically detected based +/// on the configuration. This functionality is useful when the OpenAPI definition does not +/// include an authorization scheme. +pub(crate) struct Request { + auth: Option, + method: hyper::Method, + path: String, + query_params: HashMap, + no_return_type: bool, + path_params: HashMap, + form_params: HashMap, + header_params: HashMap, + // TODO: multiple body params are possible technically, but not supported here. + serialized_body: Option, +} + +#[allow(dead_code)] +impl Request { + pub fn new(method: hyper::Method, path: String) -> Self { + Request { + auth: None, + method, + path, + query_params: HashMap::new(), + path_params: HashMap::new(), + form_params: HashMap::new(), + header_params: HashMap::new(), + serialized_body: None, + no_return_type: false, + } + } + + pub fn with_body_param(mut self, param: T) -> Self { + self.serialized_body = Some(serde_json::to_string(¶m).unwrap()); + self + } + + pub fn with_header_param(mut self, basename: String, param: String) -> Self { + self.header_params.insert(basename, param); + self + } + + #[allow(unused)] + pub fn with_query_param(mut self, basename: String, param: String) -> Self { + self.query_params.insert(basename, param); + self + } + + #[allow(unused)] + pub fn with_path_param(mut self, basename: String, param: String) -> Self { + self.path_params.insert(basename, param); + self + } + + #[allow(unused)] + pub fn with_form_param(mut self, basename: String, param: String) -> Self { + self.form_params.insert(basename, param); + self + } + + pub fn returns_nothing(mut self) -> Self { + self.no_return_type = true; + self + } + + pub fn with_auth(mut self, auth: Auth) -> Self { + self.auth = Some(auth); + self + } + + pub fn execute<'a, C, U>( + self, + conf: &configuration::Configuration, + ) -> Pin> + 'a + Send>> + where + C: Connect + Clone + std::marker::Send + Sync, + U: Sized + std::marker::Send + 'a, + for<'de> U: serde::Deserialize<'de>, + { + let mut query_string = ::url::form_urlencoded::Serializer::new("".to_owned()); + + let mut path = self.path; + for (k, v) in self.path_params { + // replace {id} with the value of the id path param + path = path.replace(&format!("{{{}}}", k), &v); + } + + for (key, val) in self.query_params { + query_string.append_pair(&key, &val); + } + + let mut uri_str = format!("{}{}", conf.base_path, path); + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri_str += "?"; + uri_str += &query_string_str; + } + let uri: hyper::Uri = match uri_str.parse() { + Err(e) => return Box::pin(futures::future::err(Error::UriError(e))), + Ok(u) => u, + }; + + let mut req_builder = hyper::Request::builder() + .uri(uri) + .method(self.method); + + // Detect the authorization type if it hasn't been set. + let auth = self.auth.unwrap_or_else(|| + if conf.api_key.is_some() { + panic!("Cannot automatically set the API key from the configuration, it must be specified in the OpenAPI definition") + } else if conf.oauth_access_token.is_some() { + Auth::Oauth + } else if conf.basic_auth.is_some() { + Auth::Basic + } else { + Auth::None + } + ); + match auth { + Auth::ApiKey(apikey) => { + if let Some(ref key) = conf.api_key { + let val = apikey.key(&key.prefix, &key.key); + if apikey.in_query { + query_string.append_pair(&apikey.param_name, &val); + } + if apikey.in_header { + req_builder = req_builder.header(&apikey.param_name, val); + } + } + } + Auth::Basic => { + if let Some(ref auth_conf) = conf.basic_auth { + let mut text = auth_conf.0.clone(); + text.push(':'); + if let Some(ref pass) = auth_conf.1 { + text.push_str(&pass[..]); + } + let encoded = base64::encode(&text); + req_builder = req_builder.header(AUTHORIZATION, encoded); + } + } + Auth::Oauth => { + if let Some(ref token) = conf.oauth_access_token { + let text = "Bearer ".to_owned() + token; + req_builder = req_builder.header(AUTHORIZATION, text); + } + } + Auth::None => {} + } + + if let Some(ref user_agent) = conf.user_agent { + req_builder = req_builder.header(USER_AGENT, match HeaderValue::from_str(user_agent) { + Ok(header_value) => header_value, + Err(e) => return Box::pin(futures::future::err(super::Error::Header(e))) + }); + } + + for (k, v) in self.header_params { + req_builder = req_builder.header(&k, v); + } + + let req_headers = req_builder.headers_mut().unwrap(); + let request_result = if self.form_params.len() > 0 { + req_headers.insert(CONTENT_TYPE, HeaderValue::from_static("application/x-www-form-urlencoded")); + let mut enc = ::url::form_urlencoded::Serializer::new("".to_owned()); + for (k, v) in self.form_params { + enc.append_pair(&k, &v); + } + req_builder.body(enc.finish()) + } else if let Some(body) = self.serialized_body { + req_headers.insert(CONTENT_TYPE, HeaderValue::from_static("application/json")); + req_headers.insert(CONTENT_LENGTH, body.len().into()); + req_builder.body(body) + } else { + req_builder.body(String::new()) + }; + let request = match request_result { + Ok(request) => request, + Err(e) => return Box::pin(futures::future::err(Error::from(e))) + }; + + let no_return_type = self.no_return_type; + Box::pin(conf.client + .request(request) + .map_err(|e| Error::from(e)) + .and_then(move |response| { + let status = response.status(); + if !status.is_success() { + futures::future::err::(Error::from((status, response.into_body()))).boxed() + } else if no_return_type { + // This is a hack; if there's no_ret_type, U is (), but serde_json gives an + // error when deserializing "" into (), so deserialize 'null' into it + // instead. + // An alternate option would be to require U: Default, and then return + // U::default() here instead since () implements that, but then we'd + // need to impl default for all models. + futures::future::ok::(serde_json::from_str("null").expect("serde null value")).boxed() + } else { + let collect = response.into_body().collect().map_err(Error::from); + collect.map(|collected| { + collected.and_then(|collected| { + serde_json::from_slice(&collected.to_bytes()).map_err(Error::from) + }) + }).boxed() + } + })) + } +} diff --git a/samples/client/petstore/rust/hyper/test-duplicates/src/apis/testing_api.rs b/samples/client/petstore/rust/hyper/test-duplicates/src/apis/testing_api.rs new file mode 100644 index 000000000000..0869d8abe284 --- /dev/null +++ b/samples/client/petstore/rust/hyper/test-duplicates/src/apis/testing_api.rs @@ -0,0 +1,53 @@ +/* + * OpenAPI Petstore + * + * To test duplicates + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use std::sync::Arc; +use std::borrow::Borrow; +use std::pin::Pin; +#[allow(unused_imports)] +use std::option::Option; + +use hyper; +use hyper_util::client::legacy::connect::Connect; +use futures::Future; + +use crate::models; +use super::{Error, configuration}; +use super::request as __internal_request; + +pub struct TestingApiClient + where C: Clone + std::marker::Send + Sync + 'static { + configuration: Arc>, +} + +impl TestingApiClient + where C: Clone + std::marker::Send + Sync { + pub fn new(configuration: Arc>) -> TestingApiClient { + TestingApiClient { + configuration, + } + } +} + +pub trait TestingApi: Send + Sync { + fn tests_discriminator_duplicate_enums_get(&self, ) -> Pin> + Send>>; +} + +implTestingApi for TestingApiClient + where C: Clone + std::marker::Send + Sync { + #[allow(unused_mut)] + fn tests_discriminator_duplicate_enums_get(&self, ) -> Pin> + Send>> { + let mut req = __internal_request::Request::new(hyper::Method::GET, "/tests/discriminatorDuplicateEnums".to_string()) + ; + + req.execute(self.configuration.borrow()) + } + +} diff --git a/samples/client/petstore/rust/hyper/test-duplicates/src/lib.rs b/samples/client/petstore/rust/hyper/test-duplicates/src/lib.rs new file mode 100644 index 000000000000..f5cfd2315405 --- /dev/null +++ b/samples/client/petstore/rust/hyper/test-duplicates/src/lib.rs @@ -0,0 +1,12 @@ +#![allow(unused_imports)] +#![allow(clippy::too_many_arguments)] + +extern crate serde_repr; +extern crate serde; +extern crate serde_json; +extern crate url; +extern crate hyper; +extern crate futures; + +pub mod apis; +pub mod models; diff --git a/samples/client/petstore/rust/reqwest-trait/petstore/src/models/_tests_discriminator_duplicate_enums_get_200_response.rs b/samples/client/petstore/rust/hyper/test-duplicates/src/models/_tests_discriminator_duplicate_enums_get_200_response.rs similarity index 90% rename from samples/client/petstore/rust/reqwest-trait/petstore/src/models/_tests_discriminator_duplicate_enums_get_200_response.rs rename to samples/client/petstore/rust/hyper/test-duplicates/src/models/_tests_discriminator_duplicate_enums_get_200_response.rs index 5f7776745949..91ae6492101b 100644 --- a/samples/client/petstore/rust/reqwest-trait/petstore/src/models/_tests_discriminator_duplicate_enums_get_200_response.rs +++ b/samples/client/petstore/rust/hyper/test-duplicates/src/models/_tests_discriminator_duplicate_enums_get_200_response.rs @@ -1,7 +1,7 @@ /* * 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. + * To test duplicates * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/client/petstore/rust/hyper0x/petstore/src/models/duplicate_test.rs b/samples/client/petstore/rust/hyper/test-duplicates/src/models/duplicate_test.rs similarity index 79% rename from samples/client/petstore/rust/hyper0x/petstore/src/models/duplicate_test.rs rename to samples/client/petstore/rust/hyper/test-duplicates/src/models/duplicate_test.rs index a27e36772fc6..c9903c458bfc 100644 --- a/samples/client/petstore/rust/hyper0x/petstore/src/models/duplicate_test.rs +++ b/samples/client/petstore/rust/hyper/test-duplicates/src/models/duplicate_test.rs @@ -1,7 +1,7 @@ /* * 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. + * To test duplicates * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/client/petstore/rust/reqwest-trait/petstore/src/models/duplicatetest.rs b/samples/client/petstore/rust/hyper/test-duplicates/src/models/duplicatetest.rs similarity index 62% rename from samples/client/petstore/rust/reqwest-trait/petstore/src/models/duplicatetest.rs rename to samples/client/petstore/rust/hyper/test-duplicates/src/models/duplicatetest.rs index f50f7b84ecbe..91447e4e4380 100644 --- a/samples/client/petstore/rust/reqwest-trait/petstore/src/models/duplicatetest.rs +++ b/samples/client/petstore/rust/hyper/test-duplicates/src/models/duplicatetest.rs @@ -1,7 +1,7 @@ /* * 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. + * To test duplicates * * The version of the OpenAPI document: 1.0.0 * @@ -12,14 +12,14 @@ use crate::models; use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Duplicatetest { +pub struct another_test { #[serde(rename = "name", skip_serializing_if = "Option::is_none")] pub name: Option, } -impl Duplicatetest { - pub fn new() -> Duplicatetest { - Duplicatetest { +impl another_test { + pub fn new() -> another_test { + another_test { name: None, } } diff --git a/samples/client/petstore/rust/hyper/test-duplicates/src/models/mod.rs b/samples/client/petstore/rust/hyper/test-duplicates/src/models/mod.rs new file mode 100644 index 000000000000..6970bef34a08 --- /dev/null +++ b/samples/client/petstore/rust/hyper/test-duplicates/src/models/mod.rs @@ -0,0 +1,10 @@ +pub mod duplicate_test; +pub use self::duplicate_test::DuplicateTest; +pub mod person; +pub use self::person::Person; +pub mod _tests_discriminator_duplicate_enums_get_200_response; +pub use self::_tests_discriminator_duplicate_enums_get_200_response::TestsDiscriminatorDuplicateEnumsGet200Response; +pub mod vehicle; +pub use self::vehicle::Vehicle; +pub mod duplicatetest; +pub use self::duplicatetest::another_test; diff --git a/samples/client/petstore/rust/hyper/test-duplicates/src/models/person.rs b/samples/client/petstore/rust/hyper/test-duplicates/src/models/person.rs new file mode 100644 index 000000000000..2e922d0e7e64 --- /dev/null +++ b/samples/client/petstore/rust/hyper/test-duplicates/src/models/person.rs @@ -0,0 +1,30 @@ +/* + * OpenAPI Petstore + * + * To test duplicates + * + * 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 Person { + #[serde(rename = "type")] + pub r#type: String, + #[serde(rename = "name")] + pub name: String, +} + +impl Person { + pub fn new(r#type: String, name: String) -> Person { + Person { + r#type, + name, + } + } +} + diff --git a/samples/client/petstore/rust/hyper/test-duplicates/src/models/vehicle.rs b/samples/client/petstore/rust/hyper/test-duplicates/src/models/vehicle.rs new file mode 100644 index 000000000000..bbc5f65cf30e --- /dev/null +++ b/samples/client/petstore/rust/hyper/test-duplicates/src/models/vehicle.rs @@ -0,0 +1,30 @@ +/* + * OpenAPI Petstore + * + * To test duplicates + * + * 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 Vehicle { + #[serde(rename = "type")] + pub r#type: String, + #[serde(rename = "speed")] + pub speed: f64, +} + +impl Vehicle { + pub fn new(r#type: String, speed: f64) -> Vehicle { + Vehicle { + r#type, + speed, + } + } +} + diff --git a/samples/client/petstore/rust/hyper0x/petstore/.openapi-generator/FILES b/samples/client/petstore/rust/hyper0x/petstore/.openapi-generator/FILES index 40cf3b75bc00..6f32de967eaa 100644 --- a/samples/client/petstore/rust/hyper0x/petstore/.openapi-generator/FILES +++ b/samples/client/petstore/rust/hyper0x/petstore/.openapi-generator/FILES @@ -8,8 +8,6 @@ docs/ApiResponse.md docs/ArrayItemRefTest.md docs/Baz.md docs/Category.md -docs/DuplicateTest.md -docs/Duplicatetest.md docs/EnumArrayTesting.md docs/FakeApi.md docs/NullableArray.md @@ -27,7 +25,6 @@ docs/StoreApi.md docs/Tag.md docs/TestAllOfWithMultiMetadataOnly.md docs/TestingApi.md -docs/TestsDiscriminatorDuplicateEnumsGet200Response.md docs/TypeTesting.md docs/UniqueItemArrayTesting.md docs/User.md @@ -43,15 +40,12 @@ src/apis/store_api.rs src/apis/testing_api.rs src/apis/user_api.rs src/lib.rs -src/models/_tests_discriminator_duplicate_enums_get_200_response.rs src/models/action_container.rs src/models/any_type_test.rs src/models/api_response.rs src/models/array_item_ref_test.rs src/models/baz.rs src/models/category.rs -src/models/duplicate_test.rs -src/models/duplicatetest.rs src/models/enum_array_testing.rs src/models/mod.rs src/models/model_ref.rs diff --git a/samples/client/petstore/rust/hyper0x/petstore/README.md b/samples/client/petstore/rust/hyper0x/petstore/README.md index 74bd6fab3aab..696831ff5d1b 100644 --- a/samples/client/petstore/rust/hyper0x/petstore/README.md +++ b/samples/client/petstore/rust/hyper0x/petstore/README.md @@ -42,7 +42,6 @@ Class | Method | HTTP request | Description *StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID *StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet *TestingApi* | [**tests_all_of_with_one_model_get**](docs/TestingApi.md#tests_all_of_with_one_model_get) | **GET** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) -*TestingApi* | [**tests_discriminator_duplicate_enums_get**](docs/TestingApi.md#tests_discriminator_duplicate_enums_get) | **GET** /tests/discriminatorDuplicateEnums | Test for duplicate enums when using discriminator. (One of the issues in #20500) *TestingApi* | [**tests_file_response_get**](docs/TestingApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file *TestingApi* | [**tests_type_testing_get**](docs/TestingApi.md#tests_type_testing_get) | **GET** /tests/typeTesting | Route to test the TypeTesting schema *UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user @@ -63,8 +62,6 @@ Class | Method | HTTP request | Description - [ArrayItemRefTest](docs/ArrayItemRefTest.md) - [Baz](docs/Baz.md) - [Category](docs/Category.md) - - [DuplicateTest](docs/DuplicateTest.md) - - [Duplicatetest](docs/Duplicatetest.md) - [EnumArrayTesting](docs/EnumArrayTesting.md) - [NullableArray](docs/NullableArray.md) - [NumericEnumTesting](docs/NumericEnumTesting.md) @@ -78,7 +75,6 @@ Class | Method | HTTP request | Description - [Return](docs/Return.md) - [Tag](docs/Tag.md) - [TestAllOfWithMultiMetadataOnly](docs/TestAllOfWithMultiMetadataOnly.md) - - [TestsDiscriminatorDuplicateEnumsGet200Response](docs/TestsDiscriminatorDuplicateEnumsGet200Response.md) - [TypeTesting](docs/TypeTesting.md) - [UniqueItemArrayTesting](docs/UniqueItemArrayTesting.md) - [User](docs/User.md) diff --git a/samples/client/petstore/rust/hyper0x/petstore/docs/DuplicateOneOf.md b/samples/client/petstore/rust/hyper0x/petstore/docs/DuplicateOneOf.md deleted file mode 100644 index 22b6b00f001b..000000000000 --- a/samples/client/petstore/rust/hyper0x/petstore/docs/DuplicateOneOf.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/PetsExplodePostPageExplodeParameter.md b/samples/client/petstore/rust/hyper0x/petstore/docs/PetsExplodePostPageExplodeParameter.md deleted file mode 100644 index 4d328f64458c..000000000000 --- a/samples/client/petstore/rust/hyper0x/petstore/docs/PetsExplodePostPageExplodeParameter.md +++ /dev/null @@ -1,12 +0,0 @@ -# PetsExplodePostPageExplodeParameter - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**size** | Option<**i64**> | The page size. | [optional][default to 10] -**number** | Option<**i64**> | The page number. | [optional][default to 1] - -[[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/PetsExplodePostPageParameter.md b/samples/client/petstore/rust/hyper0x/petstore/docs/PetsExplodePostPageParameter.md deleted file mode 100644 index feef5fcabd79..000000000000 --- a/samples/client/petstore/rust/hyper0x/petstore/docs/PetsExplodePostPageParameter.md +++ /dev/null @@ -1,12 +0,0 @@ -# PetsExplodePostPageParameter - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**size** | Option<**i64**> | The page size. | [optional][default to 10] -**number** | Option<**i64**> | The page number. | [optional][default to 1] - -[[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/TestingApi.md b/samples/client/petstore/rust/hyper0x/petstore/docs/TestingApi.md index 5439986dd2b1..a99edf6ffea8 100644 --- a/samples/client/petstore/rust/hyper0x/petstore/docs/TestingApi.md +++ b/samples/client/petstore/rust/hyper0x/petstore/docs/TestingApi.md @@ -5,7 +5,6 @@ All URIs are relative to *http://petstore.swagger.io/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**tests_all_of_with_one_model_get**](TestingApi.md#tests_all_of_with_one_model_get) | **GET** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) -[**tests_discriminator_duplicate_enums_get**](TestingApi.md#tests_discriminator_duplicate_enums_get) | **GET** /tests/discriminatorDuplicateEnums | Test for duplicate enums when using discriminator. (One of the issues in #20500) [**tests_file_response_get**](TestingApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file [**tests_type_testing_get**](TestingApi.md#tests_type_testing_get) | **GET** /tests/typeTesting | Route to test the TypeTesting schema @@ -39,31 +38,6 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## tests_discriminator_duplicate_enums_get - -> models::TestsDiscriminatorDuplicateEnumsGet200Response tests_discriminator_duplicate_enums_get() -Test for duplicate enums when using discriminator. (One of the issues in #20500) - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::TestsDiscriminatorDuplicateEnumsGet200Response**](_tests_discriminatorDuplicateEnums_get_200_response.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - ## tests_file_response_get > std::path::PathBuf tests_file_response_get() diff --git a/samples/client/petstore/rust/hyper0x/petstore/docs/WithInnerOneOfFoo.md b/samples/client/petstore/rust/hyper0x/petstore/docs/WithInnerOneOfFoo.md deleted file mode 100644 index fcf524123aca..000000000000 --- a/samples/client/petstore/rust/hyper0x/petstore/docs/WithInnerOneOfFoo.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/apis/testing_api.rs b/samples/client/petstore/rust/hyper0x/petstore/src/apis/testing_api.rs index 118c17f212af..b4fae3a7e3a8 100644 --- a/samples/client/petstore/rust/hyper0x/petstore/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/hyper0x/petstore/src/apis/testing_api.rs @@ -37,7 +37,6 @@ impl TestingApiClient pub trait TestingApi { fn tests_all_of_with_one_model_get(&self, person: models::Person) -> Pin>>>; - fn tests_discriminator_duplicate_enums_get(&self, ) -> Pin>>>; fn tests_file_response_get(&self, ) -> Pin>>>; fn tests_type_testing_get(&self, ) -> Pin>>>; } @@ -53,14 +52,6 @@ implTestingApi for TestingApiClient req.execute(self.configuration.borrow()) } - #[allow(unused_mut)] - fn tests_discriminator_duplicate_enums_get(&self, ) -> Pin>>> { - let mut req = __internal_request::Request::new(hyper::Method::GET, "/tests/discriminatorDuplicateEnums".to_string()) - ; - - req.execute(self.configuration.borrow()) - } - #[allow(unused_mut)] fn tests_file_response_get(&self, ) -> Pin>>> { let mut req = __internal_request::Request::new(hyper::Method::GET, "/tests/fileResponse".to_string()) diff --git a/samples/client/petstore/rust/hyper0x/petstore/src/models/_pets_explode_post_page_explode_parameter.rs b/samples/client/petstore/rust/hyper0x/petstore/src/models/_pets_explode_post_page_explode_parameter.rs deleted file mode 100644 index 39367534b60b..000000000000 --- a/samples/client/petstore/rust/hyper0x/petstore/src/models/_pets_explode_post_page_explode_parameter.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 PetsExplodePostPageExplodeParameter { - /// The page size. - #[serde(rename = "size", skip_serializing_if = "Option::is_none")] - pub size: Option, - /// The page number. - #[serde(rename = "number", skip_serializing_if = "Option::is_none")] - pub number: Option, -} - -impl PetsExplodePostPageExplodeParameter { - pub fn new() -> PetsExplodePostPageExplodeParameter { - PetsExplodePostPageExplodeParameter { - size: None, - number: None, - } - } -} - diff --git a/samples/client/petstore/rust/hyper0x/petstore/src/models/_pets_explode_post_page_parameter.rs b/samples/client/petstore/rust/hyper0x/petstore/src/models/_pets_explode_post_page_parameter.rs deleted file mode 100644 index 6a9d3bd2797d..000000000000 --- a/samples/client/petstore/rust/hyper0x/petstore/src/models/_pets_explode_post_page_parameter.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 PetsExplodePostPageParameter { - /// The page size. - #[serde(rename = "size", skip_serializing_if = "Option::is_none")] - pub size: Option, - /// The page number. - #[serde(rename = "number", skip_serializing_if = "Option::is_none")] - pub number: Option, -} - -impl PetsExplodePostPageParameter { - pub fn new() -> PetsExplodePostPageParameter { - PetsExplodePostPageParameter { - size: None, - number: None, - } - } -} - diff --git a/samples/client/petstore/rust/hyper0x/petstore/src/models/_tests_discriminator_duplicate_enums_get_200_response.rs b/samples/client/petstore/rust/hyper0x/petstore/src/models/_tests_discriminator_duplicate_enums_get_200_response.rs deleted file mode 100644 index 5f7776745949..000000000000 --- a/samples/client/petstore/rust/hyper0x/petstore/src/models/_tests_discriminator_duplicate_enums_get_200_response.rs +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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(tag = "objectType")] -pub enum TestsDiscriminatorDuplicateEnumsGet200Response { - #[serde(rename="car")] - Vehicle { - #[serde(rename = "type")] - r#type: String, - #[serde(rename = "name")] - name: String, - #[serde(rename = "speed")] - speed: f64, - }, - #[serde(rename="student")] - PersonStudent { - #[serde(rename = "type")] - r#type: String, - #[serde(rename = "name")] - name: String, - #[serde(rename = "speed")] - speed: f64, - }, - #[serde(rename="teacher")] - PersonTeacher { - #[serde(rename = "type")] - r#type: String, - #[serde(rename = "name")] - name: String, - #[serde(rename = "speed")] - speed: f64, - }, -} - -impl Default for TestsDiscriminatorDuplicateEnumsGet200Response { - fn default() -> Self { - Self::Vehicle { - r#type: Default::default(), - name: Default::default(), - speed: Default::default(), - } - - } -} - - 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 deleted file mode 100644 index e1039b65bcf7..000000000000 --- a/samples/client/petstore/rust/hyper0x/petstore/src/models/duplicate_one_of.rs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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 653d185cd8d7..277e6f130a45 100644 --- a/samples/client/petstore/rust/hyper0x/petstore/src/models/mod.rs +++ b/samples/client/petstore/rust/hyper0x/petstore/src/models/mod.rs @@ -10,10 +10,6 @@ pub mod baz; pub use self::baz::Baz; pub mod category; pub use self::category::Category; -pub mod duplicate_test; -pub use self::duplicate_test::DuplicateTest; -pub mod duplicatetest; -pub use self::duplicatetest::Duplicatetest; pub mod enum_array_testing; pub use self::enum_array_testing::EnumArrayTesting; pub mod nullable_array; @@ -40,8 +36,6 @@ pub mod tag; pub use self::tag::Tag; pub mod test_all_of_with_multi_metadata_only; pub use self::test_all_of_with_multi_metadata_only::TestAllOfWithMultiMetadataOnly; -pub mod _tests_discriminator_duplicate_enums_get_200_response; -pub use self::_tests_discriminator_duplicate_enums_get_200_response::TestsDiscriminatorDuplicateEnumsGet200Response; pub mod type_testing; pub use self::type_testing::TypeTesting; pub mod unique_item_array_testing; 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 deleted file mode 100644 index 26ed4ce5f116..000000000000 --- a/samples/client/petstore/rust/hyper0x/petstore/src/models/with_inner_one_of_foo.rs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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 40cf3b75bc00..6f32de967eaa 100644 --- a/samples/client/petstore/rust/reqwest-trait/petstore/.openapi-generator/FILES +++ b/samples/client/petstore/rust/reqwest-trait/petstore/.openapi-generator/FILES @@ -8,8 +8,6 @@ docs/ApiResponse.md docs/ArrayItemRefTest.md docs/Baz.md docs/Category.md -docs/DuplicateTest.md -docs/Duplicatetest.md docs/EnumArrayTesting.md docs/FakeApi.md docs/NullableArray.md @@ -27,7 +25,6 @@ docs/StoreApi.md docs/Tag.md docs/TestAllOfWithMultiMetadataOnly.md docs/TestingApi.md -docs/TestsDiscriminatorDuplicateEnumsGet200Response.md docs/TypeTesting.md docs/UniqueItemArrayTesting.md docs/User.md @@ -43,15 +40,12 @@ src/apis/store_api.rs src/apis/testing_api.rs src/apis/user_api.rs src/lib.rs -src/models/_tests_discriminator_duplicate_enums_get_200_response.rs src/models/action_container.rs src/models/any_type_test.rs src/models/api_response.rs src/models/array_item_ref_test.rs src/models/baz.rs src/models/category.rs -src/models/duplicate_test.rs -src/models/duplicatetest.rs src/models/enum_array_testing.rs src/models/mod.rs src/models/model_ref.rs diff --git a/samples/client/petstore/rust/reqwest-trait/petstore/README.md b/samples/client/petstore/rust/reqwest-trait/petstore/README.md index 1f758b389832..4de25c0d492e 100644 --- a/samples/client/petstore/rust/reqwest-trait/petstore/README.md +++ b/samples/client/petstore/rust/reqwest-trait/petstore/README.md @@ -42,7 +42,6 @@ Class | Method | HTTP request | Description *StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID *StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet *TestingApi* | [**tests_all_of_with_one_model_get**](docs/TestingApi.md#tests_all_of_with_one_model_get) | **GET** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) -*TestingApi* | [**tests_discriminator_duplicate_enums_get**](docs/TestingApi.md#tests_discriminator_duplicate_enums_get) | **GET** /tests/discriminatorDuplicateEnums | Test for duplicate enums when using discriminator. (One of the issues in #20500) *TestingApi* | [**tests_file_response_get**](docs/TestingApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file *TestingApi* | [**tests_type_testing_get**](docs/TestingApi.md#tests_type_testing_get) | **GET** /tests/typeTesting | Route to test the TypeTesting schema *UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user @@ -63,8 +62,6 @@ Class | Method | HTTP request | Description - [ArrayItemRefTest](docs/ArrayItemRefTest.md) - [Baz](docs/Baz.md) - [Category](docs/Category.md) - - [DuplicateTest](docs/DuplicateTest.md) - - [Duplicatetest](docs/Duplicatetest.md) - [EnumArrayTesting](docs/EnumArrayTesting.md) - [NullableArray](docs/NullableArray.md) - [NumericEnumTesting](docs/NumericEnumTesting.md) @@ -78,7 +75,6 @@ Class | Method | HTTP request | Description - [Return](docs/Return.md) - [Tag](docs/Tag.md) - [TestAllOfWithMultiMetadataOnly](docs/TestAllOfWithMultiMetadataOnly.md) - - [TestsDiscriminatorDuplicateEnumsGet200Response](docs/TestsDiscriminatorDuplicateEnumsGet200Response.md) - [TypeTesting](docs/TypeTesting.md) - [UniqueItemArrayTesting](docs/UniqueItemArrayTesting.md) - [User](docs/User.md) diff --git a/samples/client/petstore/rust/reqwest-trait/petstore/docs/DuplicateOneOf.md b/samples/client/petstore/rust/reqwest-trait/petstore/docs/DuplicateOneOf.md deleted file mode 100644 index 22b6b00f001b..000000000000 --- a/samples/client/petstore/rust/reqwest-trait/petstore/docs/DuplicateOneOf.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/PetsExplodePostPageExplodeParameter.md b/samples/client/petstore/rust/reqwest-trait/petstore/docs/PetsExplodePostPageExplodeParameter.md deleted file mode 100644 index 4d328f64458c..000000000000 --- a/samples/client/petstore/rust/reqwest-trait/petstore/docs/PetsExplodePostPageExplodeParameter.md +++ /dev/null @@ -1,12 +0,0 @@ -# PetsExplodePostPageExplodeParameter - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**size** | Option<**i64**> | The page size. | [optional][default to 10] -**number** | Option<**i64**> | The page number. | [optional][default to 1] - -[[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/PetsExplodePostPageParameter.md b/samples/client/petstore/rust/reqwest-trait/petstore/docs/PetsExplodePostPageParameter.md deleted file mode 100644 index feef5fcabd79..000000000000 --- a/samples/client/petstore/rust/reqwest-trait/petstore/docs/PetsExplodePostPageParameter.md +++ /dev/null @@ -1,12 +0,0 @@ -# PetsExplodePostPageParameter - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**size** | Option<**i64**> | The page size. | [optional][default to 10] -**number** | Option<**i64**> | The page number. | [optional][default to 1] - -[[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/TestingApi.md b/samples/client/petstore/rust/reqwest-trait/petstore/docs/TestingApi.md index 5439986dd2b1..a99edf6ffea8 100644 --- a/samples/client/petstore/rust/reqwest-trait/petstore/docs/TestingApi.md +++ b/samples/client/petstore/rust/reqwest-trait/petstore/docs/TestingApi.md @@ -5,7 +5,6 @@ All URIs are relative to *http://petstore.swagger.io/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**tests_all_of_with_one_model_get**](TestingApi.md#tests_all_of_with_one_model_get) | **GET** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) -[**tests_discriminator_duplicate_enums_get**](TestingApi.md#tests_discriminator_duplicate_enums_get) | **GET** /tests/discriminatorDuplicateEnums | Test for duplicate enums when using discriminator. (One of the issues in #20500) [**tests_file_response_get**](TestingApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file [**tests_type_testing_get**](TestingApi.md#tests_type_testing_get) | **GET** /tests/typeTesting | Route to test the TypeTesting schema @@ -39,31 +38,6 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## tests_discriminator_duplicate_enums_get - -> models::TestsDiscriminatorDuplicateEnumsGet200Response tests_discriminator_duplicate_enums_get() -Test for duplicate enums when using discriminator. (One of the issues in #20500) - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::TestsDiscriminatorDuplicateEnumsGet200Response**](_tests_discriminatorDuplicateEnums_get_200_response.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - ## tests_file_response_get > std::path::PathBuf tests_file_response_get() diff --git a/samples/client/petstore/rust/reqwest-trait/petstore/docs/TestsDiscriminatorDuplicateEnumsGet200Response.md b/samples/client/petstore/rust/reqwest-trait/petstore/docs/TestsDiscriminatorDuplicateEnumsGet200Response.md deleted file mode 100644 index 437935824565..000000000000 --- a/samples/client/petstore/rust/reqwest-trait/petstore/docs/TestsDiscriminatorDuplicateEnumsGet200Response.md +++ /dev/null @@ -1,10 +0,0 @@ -# TestsDiscriminatorDuplicateEnumsGet200Response - -## Enum Variants - -| Name | Value | -|---- | -----| - -[[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 deleted file mode 100644 index fcf524123aca..000000000000 --- a/samples/client/petstore/rust/reqwest-trait/petstore/docs/WithInnerOneOfFoo.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/apis/testing_api.rs b/samples/client/petstore/rust/reqwest-trait/petstore/src/apis/testing_api.rs index 636b20fc8607..40792f78f588 100644 --- a/samples/client/petstore/rust/reqwest-trait/petstore/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/reqwest-trait/petstore/src/apis/testing_api.rs @@ -28,11 +28,6 @@ pub trait TestingApi: Send + Sync { /// async fn tests_all_of_with_one_model_get<'person>(&self, person: models::Person) -> Result>; - /// GET /tests/discriminatorDuplicateEnums - /// - /// - async fn tests_discriminator_duplicate_enums_get<>(&self, ) -> Result>; - /// GET /tests/fileResponse /// /// @@ -96,43 +91,6 @@ impl TestingApi for TestingApiClient { } } - async fn tests_discriminator_duplicate_enums_get<>(&self, ) -> Result> { - let local_var_configuration = &self.configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/tests/discriminatorDuplicateEnums", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content_type = local_var_resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let local_var_content_type = super::ContentType::from(local_var_content_type); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - match local_var_content_type { - ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TestsDiscriminatorDuplicateEnumsGet200Response`"))), - ContentType::Unsupported(local_var_unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{local_var_unknown_type}` content type response that cannot be converted to `models::TestsDiscriminatorDuplicateEnumsGet200Response`")))), - } - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } - } - async fn tests_file_response_get<>(&self, ) -> Result> { let local_var_configuration = &self.configuration; @@ -216,13 +174,6 @@ pub enum TestsAllOfWithOneModelGetError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`tests_discriminator_duplicate_enums_get`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum TestsDiscriminatorDuplicateEnumsGetError { - UnknownValue(serde_json::Value), -} - /// struct for typed errors of method [`tests_file_response_get`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] diff --git a/samples/client/petstore/rust/reqwest-trait/petstore/src/models/_pets_explode_post_page_explode_parameter.rs b/samples/client/petstore/rust/reqwest-trait/petstore/src/models/_pets_explode_post_page_explode_parameter.rs deleted file mode 100644 index 39367534b60b..000000000000 --- a/samples/client/petstore/rust/reqwest-trait/petstore/src/models/_pets_explode_post_page_explode_parameter.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 PetsExplodePostPageExplodeParameter { - /// The page size. - #[serde(rename = "size", skip_serializing_if = "Option::is_none")] - pub size: Option, - /// The page number. - #[serde(rename = "number", skip_serializing_if = "Option::is_none")] - pub number: Option, -} - -impl PetsExplodePostPageExplodeParameter { - pub fn new() -> PetsExplodePostPageExplodeParameter { - PetsExplodePostPageExplodeParameter { - size: None, - number: None, - } - } -} - diff --git a/samples/client/petstore/rust/reqwest-trait/petstore/src/models/_pets_explode_post_page_parameter.rs b/samples/client/petstore/rust/reqwest-trait/petstore/src/models/_pets_explode_post_page_parameter.rs deleted file mode 100644 index 6a9d3bd2797d..000000000000 --- a/samples/client/petstore/rust/reqwest-trait/petstore/src/models/_pets_explode_post_page_parameter.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 PetsExplodePostPageParameter { - /// The page size. - #[serde(rename = "size", skip_serializing_if = "Option::is_none")] - pub size: Option, - /// The page number. - #[serde(rename = "number", skip_serializing_if = "Option::is_none")] - pub number: Option, -} - -impl PetsExplodePostPageParameter { - pub fn new() -> PetsExplodePostPageParameter { - PetsExplodePostPageParameter { - size: None, - number: None, - } - } -} - 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 deleted file mode 100644 index ad47a777daec..000000000000 --- a/samples/client/petstore/rust/reqwest-trait/petstore/src/models/duplicate_one_of.rs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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 653d185cd8d7..277e6f130a45 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,10 +10,6 @@ pub mod baz; pub use self::baz::Baz; pub mod category; pub use self::category::Category; -pub mod duplicate_test; -pub use self::duplicate_test::DuplicateTest; -pub mod duplicatetest; -pub use self::duplicatetest::Duplicatetest; pub mod enum_array_testing; pub use self::enum_array_testing::EnumArrayTesting; pub mod nullable_array; @@ -40,8 +36,6 @@ pub mod tag; pub use self::tag::Tag; pub mod test_all_of_with_multi_metadata_only; pub use self::test_all_of_with_multi_metadata_only::TestAllOfWithMultiMetadataOnly; -pub mod _tests_discriminator_duplicate_enums_get_200_response; -pub use self::_tests_discriminator_duplicate_enums_get_200_response::TestsDiscriminatorDuplicateEnumsGet200Response; pub mod type_testing; pub use self::type_testing::TypeTesting; pub mod unique_item_array_testing; 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 deleted file mode 100644 index 9917806aa62b..000000000000 --- a/samples/client/petstore/rust/reqwest-trait/petstore/src/models/with_inner_one_of_foo.rs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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 40cf3b75bc00..6f32de967eaa 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,8 +8,6 @@ docs/ApiResponse.md docs/ArrayItemRefTest.md docs/Baz.md docs/Category.md -docs/DuplicateTest.md -docs/Duplicatetest.md docs/EnumArrayTesting.md docs/FakeApi.md docs/NullableArray.md @@ -27,7 +25,6 @@ docs/StoreApi.md docs/Tag.md docs/TestAllOfWithMultiMetadataOnly.md docs/TestingApi.md -docs/TestsDiscriminatorDuplicateEnumsGet200Response.md docs/TypeTesting.md docs/UniqueItemArrayTesting.md docs/User.md @@ -43,15 +40,12 @@ src/apis/store_api.rs src/apis/testing_api.rs src/apis/user_api.rs src/lib.rs -src/models/_tests_discriminator_duplicate_enums_get_200_response.rs src/models/action_container.rs src/models/any_type_test.rs src/models/api_response.rs src/models/array_item_ref_test.rs src/models/baz.rs src/models/category.rs -src/models/duplicate_test.rs -src/models/duplicatetest.rs src/models/enum_array_testing.rs src/models/mod.rs src/models/model_ref.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 44d8ca58eb41..e54a66a9ed01 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/README.md +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/README.md @@ -42,7 +42,6 @@ Class | Method | HTTP request | Description *StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID *StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet *TestingApi* | [**tests_all_of_with_one_model_get**](docs/TestingApi.md#tests_all_of_with_one_model_get) | **GET** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) -*TestingApi* | [**tests_discriminator_duplicate_enums_get**](docs/TestingApi.md#tests_discriminator_duplicate_enums_get) | **GET** /tests/discriminatorDuplicateEnums | Test for duplicate enums when using discriminator. (One of the issues in #20500) *TestingApi* | [**tests_file_response_get**](docs/TestingApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file *TestingApi* | [**tests_type_testing_get**](docs/TestingApi.md#tests_type_testing_get) | **GET** /tests/typeTesting | Route to test the TypeTesting schema *UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user @@ -63,8 +62,6 @@ Class | Method | HTTP request | Description - [ArrayItemRefTest](docs/ArrayItemRefTest.md) - [Baz](docs/Baz.md) - [Category](docs/Category.md) - - [DuplicateTest](docs/DuplicateTest.md) - - [Duplicatetest](docs/Duplicatetest.md) - [EnumArrayTesting](docs/EnumArrayTesting.md) - [NullableArray](docs/NullableArray.md) - [NumericEnumTesting](docs/NumericEnumTesting.md) @@ -78,7 +75,6 @@ Class | Method | HTTP request | Description - [Return](docs/Return.md) - [Tag](docs/Tag.md) - [TestAllOfWithMultiMetadataOnly](docs/TestAllOfWithMultiMetadataOnly.md) - - [TestsDiscriminatorDuplicateEnumsGet200Response](docs/TestsDiscriminatorDuplicateEnumsGet200Response.md) - [TypeTesting](docs/TypeTesting.md) - [UniqueItemArrayTesting](docs/UniqueItemArrayTesting.md) - [User](docs/User.md) 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 deleted file mode 100644 index 22b6b00f001b..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/DuplicateOneOf.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/DuplicateTest.md b/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/DuplicateTest.md deleted file mode 100644 index b9dd67677d29..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/DuplicateTest.md +++ /dev/null @@ -1,11 +0,0 @@ -# DuplicateTest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | Option<**String**> | | [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/Duplicatetest.md b/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/Duplicatetest.md deleted file mode 100644 index dab029dbf559..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/Duplicatetest.md +++ /dev/null @@ -1,11 +0,0 @@ -# Duplicatetest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | Option<**String**> | | [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/PetsExplodePostPageExplodeParameter.md b/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/PetsExplodePostPageExplodeParameter.md deleted file mode 100644 index 4d328f64458c..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/PetsExplodePostPageExplodeParameter.md +++ /dev/null @@ -1,12 +0,0 @@ -# PetsExplodePostPageExplodeParameter - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**size** | Option<**i64**> | The page size. | [optional][default to 10] -**number** | Option<**i64**> | The page number. | [optional][default to 1] - -[[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/PetsExplodePostPageParameter.md b/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/PetsExplodePostPageParameter.md deleted file mode 100644 index feef5fcabd79..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/PetsExplodePostPageParameter.md +++ /dev/null @@ -1,12 +0,0 @@ -# PetsExplodePostPageParameter - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**size** | Option<**i64**> | The page size. | [optional][default to 10] -**number** | Option<**i64**> | The page number. | [optional][default to 1] - -[[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/TestingApi.md b/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/TestingApi.md index 5439986dd2b1..a99edf6ffea8 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/TestingApi.md +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/TestingApi.md @@ -5,7 +5,6 @@ All URIs are relative to *http://petstore.swagger.io/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**tests_all_of_with_one_model_get**](TestingApi.md#tests_all_of_with_one_model_get) | **GET** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) -[**tests_discriminator_duplicate_enums_get**](TestingApi.md#tests_discriminator_duplicate_enums_get) | **GET** /tests/discriminatorDuplicateEnums | Test for duplicate enums when using discriminator. (One of the issues in #20500) [**tests_file_response_get**](TestingApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file [**tests_type_testing_get**](TestingApi.md#tests_type_testing_get) | **GET** /tests/typeTesting | Route to test the TypeTesting schema @@ -39,31 +38,6 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## tests_discriminator_duplicate_enums_get - -> models::TestsDiscriminatorDuplicateEnumsGet200Response tests_discriminator_duplicate_enums_get() -Test for duplicate enums when using discriminator. (One of the issues in #20500) - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::TestsDiscriminatorDuplicateEnumsGet200Response**](_tests_discriminatorDuplicateEnums_get_200_response.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - ## tests_file_response_get > std::path::PathBuf tests_file_response_get() diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/TestsDiscriminatorDuplicateEnumsGet200Response.md b/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/TestsDiscriminatorDuplicateEnumsGet200Response.md deleted file mode 100644 index 437935824565..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/TestsDiscriminatorDuplicateEnumsGet200Response.md +++ /dev/null @@ -1,10 +0,0 @@ -# TestsDiscriminatorDuplicateEnumsGet200Response - -## Enum Variants - -| Name | Value | -|---- | -----| - -[[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 deleted file mode 100644 index fcf524123aca..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/WithInnerOneOfFoo.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/apis/testing_api.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/testing_api.rs index a6ac53846f29..0a8e733d6cf7 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/testing_api.rs @@ -29,14 +29,6 @@ pub enum TestsAllOfWithOneModelGetSuccess { UnknownValue(serde_json::Value), } -/// struct for typed successes of method [`tests_discriminator_duplicate_enums_get`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum TestsDiscriminatorDuplicateEnumsGetSuccess { - Status200(models::TestsDiscriminatorDuplicateEnumsGet200Response), - UnknownValue(serde_json::Value), -} - /// struct for typed successes of method [`tests_file_response_get`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -60,13 +52,6 @@ pub enum TestsAllOfWithOneModelGetError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`tests_discriminator_duplicate_enums_get`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum TestsDiscriminatorDuplicateEnumsGetError { - UnknownValue(serde_json::Value), -} - /// struct for typed errors of method [`tests_file_response_get`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -108,31 +93,6 @@ pub async fn tests_all_of_with_one_model_get(configuration: &configuration::Conf } } -pub async fn tests_discriminator_duplicate_enums_get(configuration: &configuration::Configuration) -> Result, Error> { - - let uri_str = format!("{}/tests/discriminatorDuplicateEnums", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Ok(ResponseContent { status, content, entity }) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { status, content, entity })) - } -} - pub async fn tests_file_response_get(configuration: &configuration::Configuration) -> Result> { let uri_str = format!("{}/tests/fileResponse", configuration.base_path); diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/_pets_explode_post_page_explode_parameter.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/_pets_explode_post_page_explode_parameter.rs deleted file mode 100644 index 39367534b60b..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/_pets_explode_post_page_explode_parameter.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 PetsExplodePostPageExplodeParameter { - /// The page size. - #[serde(rename = "size", skip_serializing_if = "Option::is_none")] - pub size: Option, - /// The page number. - #[serde(rename = "number", skip_serializing_if = "Option::is_none")] - pub number: Option, -} - -impl PetsExplodePostPageExplodeParameter { - pub fn new() -> PetsExplodePostPageExplodeParameter { - PetsExplodePostPageExplodeParameter { - size: None, - number: None, - } - } -} - diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/_pets_explode_post_page_parameter.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/_pets_explode_post_page_parameter.rs deleted file mode 100644 index 6a9d3bd2797d..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/_pets_explode_post_page_parameter.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 PetsExplodePostPageParameter { - /// The page size. - #[serde(rename = "size", skip_serializing_if = "Option::is_none")] - pub size: Option, - /// The page number. - #[serde(rename = "number", skip_serializing_if = "Option::is_none")] - pub number: Option, -} - -impl PetsExplodePostPageParameter { - pub fn new() -> PetsExplodePostPageParameter { - PetsExplodePostPageParameter { - size: None, - number: None, - } - } -} - 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 deleted file mode 100644 index e1039b65bcf7..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/duplicate_one_of.rs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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/duplicate_test.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/duplicate_test.rs deleted file mode 100644 index a27e36772fc6..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/duplicate_test.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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 DuplicateTest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, -} - -impl DuplicateTest { - pub fn new() -> DuplicateTest { - DuplicateTest { - name: None, - } - } -} - diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/duplicatetest.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/duplicatetest.rs deleted file mode 100644 index f50f7b84ecbe..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/duplicatetest.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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 Duplicatetest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, -} - -impl Duplicatetest { - pub fn new() -> Duplicatetest { - Duplicatetest { - name: None, - } - } -} - 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 653d185cd8d7..277e6f130a45 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,10 +10,6 @@ pub mod baz; pub use self::baz::Baz; pub mod category; pub use self::category::Category; -pub mod duplicate_test; -pub use self::duplicate_test::DuplicateTest; -pub mod duplicatetest; -pub use self::duplicatetest::Duplicatetest; pub mod enum_array_testing; pub use self::enum_array_testing::EnumArrayTesting; pub mod nullable_array; @@ -40,8 +36,6 @@ pub mod tag; pub use self::tag::Tag; pub mod test_all_of_with_multi_metadata_only; pub use self::test_all_of_with_multi_metadata_only::TestAllOfWithMultiMetadataOnly; -pub mod _tests_discriminator_duplicate_enums_get_200_response; -pub use self::_tests_discriminator_duplicate_enums_get_200_response::TestsDiscriminatorDuplicateEnumsGet200Response; pub mod type_testing; pub use self::type_testing::TypeTesting; pub mod unique_item_array_testing; 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 deleted file mode 100644 index 26ed4ce5f116..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/with_inner_one_of_foo.rs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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 40cf3b75bc00..6f32de967eaa 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,8 +8,6 @@ docs/ApiResponse.md docs/ArrayItemRefTest.md docs/Baz.md docs/Category.md -docs/DuplicateTest.md -docs/Duplicatetest.md docs/EnumArrayTesting.md docs/FakeApi.md docs/NullableArray.md @@ -27,7 +25,6 @@ docs/StoreApi.md docs/Tag.md docs/TestAllOfWithMultiMetadataOnly.md docs/TestingApi.md -docs/TestsDiscriminatorDuplicateEnumsGet200Response.md docs/TypeTesting.md docs/UniqueItemArrayTesting.md docs/User.md @@ -43,15 +40,12 @@ src/apis/store_api.rs src/apis/testing_api.rs src/apis/user_api.rs src/lib.rs -src/models/_tests_discriminator_duplicate_enums_get_200_response.rs src/models/action_container.rs src/models/any_type_test.rs src/models/api_response.rs src/models/array_item_ref_test.rs src/models/baz.rs src/models/category.rs -src/models/duplicate_test.rs -src/models/duplicatetest.rs src/models/enum_array_testing.rs src/models/mod.rs src/models/model_ref.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 1235f031c8f7..f617fb4e6e56 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/README.md +++ b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/README.md @@ -42,7 +42,6 @@ Class | Method | HTTP request | Description *StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID *StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet *TestingApi* | [**tests_all_of_with_one_model_get**](docs/TestingApi.md#tests_all_of_with_one_model_get) | **GET** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) -*TestingApi* | [**tests_discriminator_duplicate_enums_get**](docs/TestingApi.md#tests_discriminator_duplicate_enums_get) | **GET** /tests/discriminatorDuplicateEnums | Test for duplicate enums when using discriminator. (One of the issues in #20500) *TestingApi* | [**tests_file_response_get**](docs/TestingApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file *TestingApi* | [**tests_type_testing_get**](docs/TestingApi.md#tests_type_testing_get) | **GET** /tests/typeTesting | Route to test the TypeTesting schema *UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user @@ -63,8 +62,6 @@ Class | Method | HTTP request | Description - [ArrayItemRefTest](docs/ArrayItemRefTest.md) - [Baz](docs/Baz.md) - [Category](docs/Category.md) - - [DuplicateTest](docs/DuplicateTest.md) - - [Duplicatetest](docs/Duplicatetest.md) - [EnumArrayTesting](docs/EnumArrayTesting.md) - [NullableArray](docs/NullableArray.md) - [NumericEnumTesting](docs/NumericEnumTesting.md) @@ -78,7 +75,6 @@ Class | Method | HTTP request | Description - [Return](docs/Return.md) - [Tag](docs/Tag.md) - [TestAllOfWithMultiMetadataOnly](docs/TestAllOfWithMultiMetadataOnly.md) - - [TestsDiscriminatorDuplicateEnumsGet200Response](docs/TestsDiscriminatorDuplicateEnumsGet200Response.md) - [TypeTesting](docs/TypeTesting.md) - [UniqueItemArrayTesting](docs/UniqueItemArrayTesting.md) - [User](docs/User.md) 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 deleted file mode 100644 index 22b6b00f001b..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/DuplicateOneOf.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/DuplicateTest.md b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/DuplicateTest.md deleted file mode 100644 index b9dd67677d29..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/DuplicateTest.md +++ /dev/null @@ -1,11 +0,0 @@ -# DuplicateTest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | Option<**String**> | | [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/Duplicatetest.md b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/Duplicatetest.md deleted file mode 100644 index dab029dbf559..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/Duplicatetest.md +++ /dev/null @@ -1,11 +0,0 @@ -# Duplicatetest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | Option<**String**> | | [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/PetsExplodePostPageExplodeParameter.md b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/PetsExplodePostPageExplodeParameter.md deleted file mode 100644 index 4d328f64458c..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/PetsExplodePostPageExplodeParameter.md +++ /dev/null @@ -1,12 +0,0 @@ -# PetsExplodePostPageExplodeParameter - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**size** | Option<**i64**> | The page size. | [optional][default to 10] -**number** | Option<**i64**> | The page number. | [optional][default to 1] - -[[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/PetsExplodePostPageParameter.md b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/PetsExplodePostPageParameter.md deleted file mode 100644 index feef5fcabd79..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/PetsExplodePostPageParameter.md +++ /dev/null @@ -1,12 +0,0 @@ -# PetsExplodePostPageParameter - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**size** | Option<**i64**> | The page size. | [optional][default to 10] -**number** | Option<**i64**> | The page number. | [optional][default to 1] - -[[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/TestingApi.md b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/TestingApi.md index 5439986dd2b1..a99edf6ffea8 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/TestingApi.md +++ b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/TestingApi.md @@ -5,7 +5,6 @@ All URIs are relative to *http://petstore.swagger.io/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**tests_all_of_with_one_model_get**](TestingApi.md#tests_all_of_with_one_model_get) | **GET** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) -[**tests_discriminator_duplicate_enums_get**](TestingApi.md#tests_discriminator_duplicate_enums_get) | **GET** /tests/discriminatorDuplicateEnums | Test for duplicate enums when using discriminator. (One of the issues in #20500) [**tests_file_response_get**](TestingApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file [**tests_type_testing_get**](TestingApi.md#tests_type_testing_get) | **GET** /tests/typeTesting | Route to test the TypeTesting schema @@ -39,31 +38,6 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## tests_discriminator_duplicate_enums_get - -> models::TestsDiscriminatorDuplicateEnumsGet200Response tests_discriminator_duplicate_enums_get() -Test for duplicate enums when using discriminator. (One of the issues in #20500) - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::TestsDiscriminatorDuplicateEnumsGet200Response**](_tests_discriminatorDuplicateEnums_get_200_response.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - ## tests_file_response_get > std::path::PathBuf tests_file_response_get() diff --git a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/TestsDiscriminatorDuplicateEnumsGet200Response.md b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/TestsDiscriminatorDuplicateEnumsGet200Response.md deleted file mode 100644 index 437935824565..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/TestsDiscriminatorDuplicateEnumsGet200Response.md +++ /dev/null @@ -1,10 +0,0 @@ -# TestsDiscriminatorDuplicateEnumsGet200Response - -## Enum Variants - -| Name | Value | -|---- | -----| - -[[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 deleted file mode 100644 index fcf524123aca..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/docs/WithInnerOneOfFoo.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/apis/testing_api.rs b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/apis/testing_api.rs index a6ac53846f29..0a8e733d6cf7 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/apis/testing_api.rs @@ -29,14 +29,6 @@ pub enum TestsAllOfWithOneModelGetSuccess { UnknownValue(serde_json::Value), } -/// struct for typed successes of method [`tests_discriminator_duplicate_enums_get`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum TestsDiscriminatorDuplicateEnumsGetSuccess { - Status200(models::TestsDiscriminatorDuplicateEnumsGet200Response), - UnknownValue(serde_json::Value), -} - /// struct for typed successes of method [`tests_file_response_get`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -60,13 +52,6 @@ pub enum TestsAllOfWithOneModelGetError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`tests_discriminator_duplicate_enums_get`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum TestsDiscriminatorDuplicateEnumsGetError { - UnknownValue(serde_json::Value), -} - /// struct for typed errors of method [`tests_file_response_get`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -108,31 +93,6 @@ pub async fn tests_all_of_with_one_model_get(configuration: &configuration::Conf } } -pub async fn tests_discriminator_duplicate_enums_get(configuration: &configuration::Configuration) -> Result, Error> { - - let uri_str = format!("{}/tests/discriminatorDuplicateEnums", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Ok(ResponseContent { status, content, entity }) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { status, content, entity })) - } -} - pub async fn tests_file_response_get(configuration: &configuration::Configuration) -> Result> { let uri_str = format!("{}/tests/fileResponse", configuration.base_path); diff --git a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/_pets_explode_post_page_explode_parameter.rs b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/_pets_explode_post_page_explode_parameter.rs deleted file mode 100644 index 39367534b60b..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/_pets_explode_post_page_explode_parameter.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 PetsExplodePostPageExplodeParameter { - /// The page size. - #[serde(rename = "size", skip_serializing_if = "Option::is_none")] - pub size: Option, - /// The page number. - #[serde(rename = "number", skip_serializing_if = "Option::is_none")] - pub number: Option, -} - -impl PetsExplodePostPageExplodeParameter { - pub fn new() -> PetsExplodePostPageExplodeParameter { - PetsExplodePostPageExplodeParameter { - size: None, - number: None, - } - } -} - diff --git a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/_pets_explode_post_page_parameter.rs b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/_pets_explode_post_page_parameter.rs deleted file mode 100644 index 6a9d3bd2797d..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/_pets_explode_post_page_parameter.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 PetsExplodePostPageParameter { - /// The page size. - #[serde(rename = "size", skip_serializing_if = "Option::is_none")] - pub size: Option, - /// The page number. - #[serde(rename = "number", skip_serializing_if = "Option::is_none")] - pub number: Option, -} - -impl PetsExplodePostPageParameter { - pub fn new() -> PetsExplodePostPageParameter { - PetsExplodePostPageParameter { - size: None, - number: None, - } - } -} - diff --git a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/_tests_discriminator_duplicate_enums_get_200_response.rs b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/_tests_discriminator_duplicate_enums_get_200_response.rs deleted file mode 100644 index 5f7776745949..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/_tests_discriminator_duplicate_enums_get_200_response.rs +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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(tag = "objectType")] -pub enum TestsDiscriminatorDuplicateEnumsGet200Response { - #[serde(rename="car")] - Vehicle { - #[serde(rename = "type")] - r#type: String, - #[serde(rename = "name")] - name: String, - #[serde(rename = "speed")] - speed: f64, - }, - #[serde(rename="student")] - PersonStudent { - #[serde(rename = "type")] - r#type: String, - #[serde(rename = "name")] - name: String, - #[serde(rename = "speed")] - speed: f64, - }, - #[serde(rename="teacher")] - PersonTeacher { - #[serde(rename = "type")] - r#type: String, - #[serde(rename = "name")] - name: String, - #[serde(rename = "speed")] - speed: f64, - }, -} - -impl Default for TestsDiscriminatorDuplicateEnumsGet200Response { - fn default() -> Self { - Self::Vehicle { - r#type: Default::default(), - name: Default::default(), - speed: Default::default(), - } - - } -} - - 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 deleted file mode 100644 index e1039b65bcf7..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/duplicate_one_of.rs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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/duplicate_test.rs b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/duplicate_test.rs deleted file mode 100644 index a27e36772fc6..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/duplicate_test.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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 DuplicateTest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, -} - -impl DuplicateTest { - pub fn new() -> DuplicateTest { - DuplicateTest { - name: None, - } - } -} - diff --git a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/duplicatetest.rs b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/duplicatetest.rs deleted file mode 100644 index f50f7b84ecbe..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/duplicatetest.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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 Duplicatetest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, -} - -impl Duplicatetest { - pub fn new() -> Duplicatetest { - Duplicatetest { - name: None, - } - } -} - 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 653d185cd8d7..277e6f130a45 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,10 +10,6 @@ pub mod baz; pub use self::baz::Baz; pub mod category; pub use self::category::Category; -pub mod duplicate_test; -pub use self::duplicate_test::DuplicateTest; -pub mod duplicatetest; -pub use self::duplicatetest::Duplicatetest; pub mod enum_array_testing; pub use self::enum_array_testing::EnumArrayTesting; pub mod nullable_array; @@ -40,8 +36,6 @@ pub mod tag; pub use self::tag::Tag; pub mod test_all_of_with_multi_metadata_only; pub use self::test_all_of_with_multi_metadata_only::TestAllOfWithMultiMetadataOnly; -pub mod _tests_discriminator_duplicate_enums_get_200_response; -pub use self::_tests_discriminator_duplicate_enums_get_200_response::TestsDiscriminatorDuplicateEnumsGet200Response; pub mod type_testing; pub use self::type_testing::TypeTesting; pub mod unique_item_array_testing; 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 deleted file mode 100644 index 26ed4ce5f116..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/with_inner_one_of_foo.rs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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 40cf3b75bc00..6f32de967eaa 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/.openapi-generator/FILES +++ b/samples/client/petstore/rust/reqwest/petstore-async/.openapi-generator/FILES @@ -8,8 +8,6 @@ docs/ApiResponse.md docs/ArrayItemRefTest.md docs/Baz.md docs/Category.md -docs/DuplicateTest.md -docs/Duplicatetest.md docs/EnumArrayTesting.md docs/FakeApi.md docs/NullableArray.md @@ -27,7 +25,6 @@ docs/StoreApi.md docs/Tag.md docs/TestAllOfWithMultiMetadataOnly.md docs/TestingApi.md -docs/TestsDiscriminatorDuplicateEnumsGet200Response.md docs/TypeTesting.md docs/UniqueItemArrayTesting.md docs/User.md @@ -43,15 +40,12 @@ src/apis/store_api.rs src/apis/testing_api.rs src/apis/user_api.rs src/lib.rs -src/models/_tests_discriminator_duplicate_enums_get_200_response.rs src/models/action_container.rs src/models/any_type_test.rs src/models/api_response.rs src/models/array_item_ref_test.rs src/models/baz.rs src/models/category.rs -src/models/duplicate_test.rs -src/models/duplicatetest.rs src/models/enum_array_testing.rs src/models/mod.rs src/models/model_ref.rs diff --git a/samples/client/petstore/rust/reqwest/petstore-async/README.md b/samples/client/petstore/rust/reqwest/petstore-async/README.md index 261f526b6ba1..ed42444ff7d0 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/README.md +++ b/samples/client/petstore/rust/reqwest/petstore-async/README.md @@ -42,7 +42,6 @@ Class | Method | HTTP request | Description *StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID *StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet *TestingApi* | [**tests_all_of_with_one_model_get**](docs/TestingApi.md#tests_all_of_with_one_model_get) | **GET** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) -*TestingApi* | [**tests_discriminator_duplicate_enums_get**](docs/TestingApi.md#tests_discriminator_duplicate_enums_get) | **GET** /tests/discriminatorDuplicateEnums | Test for duplicate enums when using discriminator. (One of the issues in #20500) *TestingApi* | [**tests_file_response_get**](docs/TestingApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file *TestingApi* | [**tests_type_testing_get**](docs/TestingApi.md#tests_type_testing_get) | **GET** /tests/typeTesting | Route to test the TypeTesting schema *UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user @@ -63,8 +62,6 @@ Class | Method | HTTP request | Description - [ArrayItemRefTest](docs/ArrayItemRefTest.md) - [Baz](docs/Baz.md) - [Category](docs/Category.md) - - [DuplicateTest](docs/DuplicateTest.md) - - [Duplicatetest](docs/Duplicatetest.md) - [EnumArrayTesting](docs/EnumArrayTesting.md) - [NullableArray](docs/NullableArray.md) - [NumericEnumTesting](docs/NumericEnumTesting.md) @@ -78,7 +75,6 @@ Class | Method | HTTP request | Description - [Return](docs/Return.md) - [Tag](docs/Tag.md) - [TestAllOfWithMultiMetadataOnly](docs/TestAllOfWithMultiMetadataOnly.md) - - [TestsDiscriminatorDuplicateEnumsGet200Response](docs/TestsDiscriminatorDuplicateEnumsGet200Response.md) - [TypeTesting](docs/TypeTesting.md) - [UniqueItemArrayTesting](docs/UniqueItemArrayTesting.md) - [User](docs/User.md) diff --git a/samples/client/petstore/rust/reqwest/petstore-async/docs/DuplicateOneOf.md b/samples/client/petstore/rust/reqwest/petstore-async/docs/DuplicateOneOf.md deleted file mode 100644 index 22b6b00f001b..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-async/docs/DuplicateOneOf.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/DuplicateTest.md b/samples/client/petstore/rust/reqwest/petstore-async/docs/DuplicateTest.md deleted file mode 100644 index b9dd67677d29..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-async/docs/DuplicateTest.md +++ /dev/null @@ -1,11 +0,0 @@ -# DuplicateTest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | Option<**String**> | | [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/Duplicatetest.md b/samples/client/petstore/rust/reqwest/petstore-async/docs/Duplicatetest.md deleted file mode 100644 index dab029dbf559..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-async/docs/Duplicatetest.md +++ /dev/null @@ -1,11 +0,0 @@ -# Duplicatetest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | Option<**String**> | | [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/PetsExplodePostPageExplodeParameter.md b/samples/client/petstore/rust/reqwest/petstore-async/docs/PetsExplodePostPageExplodeParameter.md deleted file mode 100644 index 4d328f64458c..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-async/docs/PetsExplodePostPageExplodeParameter.md +++ /dev/null @@ -1,12 +0,0 @@ -# PetsExplodePostPageExplodeParameter - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**size** | Option<**i64**> | The page size. | [optional][default to 10] -**number** | Option<**i64**> | The page number. | [optional][default to 1] - -[[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/PetsExplodePostPageParameter.md b/samples/client/petstore/rust/reqwest/petstore-async/docs/PetsExplodePostPageParameter.md deleted file mode 100644 index feef5fcabd79..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-async/docs/PetsExplodePostPageParameter.md +++ /dev/null @@ -1,12 +0,0 @@ -# PetsExplodePostPageParameter - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**size** | Option<**i64**> | The page size. | [optional][default to 10] -**number** | Option<**i64**> | The page number. | [optional][default to 1] - -[[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/TestingApi.md b/samples/client/petstore/rust/reqwest/petstore-async/docs/TestingApi.md index 5439986dd2b1..a99edf6ffea8 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/docs/TestingApi.md +++ b/samples/client/petstore/rust/reqwest/petstore-async/docs/TestingApi.md @@ -5,7 +5,6 @@ All URIs are relative to *http://petstore.swagger.io/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**tests_all_of_with_one_model_get**](TestingApi.md#tests_all_of_with_one_model_get) | **GET** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) -[**tests_discriminator_duplicate_enums_get**](TestingApi.md#tests_discriminator_duplicate_enums_get) | **GET** /tests/discriminatorDuplicateEnums | Test for duplicate enums when using discriminator. (One of the issues in #20500) [**tests_file_response_get**](TestingApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file [**tests_type_testing_get**](TestingApi.md#tests_type_testing_get) | **GET** /tests/typeTesting | Route to test the TypeTesting schema @@ -39,31 +38,6 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## tests_discriminator_duplicate_enums_get - -> models::TestsDiscriminatorDuplicateEnumsGet200Response tests_discriminator_duplicate_enums_get() -Test for duplicate enums when using discriminator. (One of the issues in #20500) - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::TestsDiscriminatorDuplicateEnumsGet200Response**](_tests_discriminatorDuplicateEnums_get_200_response.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - ## tests_file_response_get > std::path::PathBuf tests_file_response_get() diff --git a/samples/client/petstore/rust/reqwest/petstore-async/docs/TestsDiscriminatorDuplicateEnumsGet200Response.md b/samples/client/petstore/rust/reqwest/petstore-async/docs/TestsDiscriminatorDuplicateEnumsGet200Response.md deleted file mode 100644 index 437935824565..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-async/docs/TestsDiscriminatorDuplicateEnumsGet200Response.md +++ /dev/null @@ -1,10 +0,0 @@ -# TestsDiscriminatorDuplicateEnumsGet200Response - -## Enum Variants - -| Name | Value | -|---- | -----| - -[[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 deleted file mode 100644 index fcf524123aca..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-async/docs/WithInnerOneOfFoo.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/apis/testing_api.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/testing_api.rs index a6ac53846f29..0a8e733d6cf7 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/testing_api.rs @@ -29,14 +29,6 @@ pub enum TestsAllOfWithOneModelGetSuccess { UnknownValue(serde_json::Value), } -/// struct for typed successes of method [`tests_discriminator_duplicate_enums_get`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum TestsDiscriminatorDuplicateEnumsGetSuccess { - Status200(models::TestsDiscriminatorDuplicateEnumsGet200Response), - UnknownValue(serde_json::Value), -} - /// struct for typed successes of method [`tests_file_response_get`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -60,13 +52,6 @@ pub enum TestsAllOfWithOneModelGetError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`tests_discriminator_duplicate_enums_get`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum TestsDiscriminatorDuplicateEnumsGetError { - UnknownValue(serde_json::Value), -} - /// struct for typed errors of method [`tests_file_response_get`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -108,31 +93,6 @@ pub async fn tests_all_of_with_one_model_get(configuration: &configuration::Conf } } -pub async fn tests_discriminator_duplicate_enums_get(configuration: &configuration::Configuration) -> Result, Error> { - - let uri_str = format!("{}/tests/discriminatorDuplicateEnums", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Ok(ResponseContent { status, content, entity }) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { status, content, entity })) - } -} - pub async fn tests_file_response_get(configuration: &configuration::Configuration) -> Result> { let uri_str = format!("{}/tests/fileResponse", configuration.base_path); diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/_pets_explode_post_page_explode_parameter.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/_pets_explode_post_page_explode_parameter.rs deleted file mode 100644 index 39367534b60b..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/_pets_explode_post_page_explode_parameter.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 PetsExplodePostPageExplodeParameter { - /// The page size. - #[serde(rename = "size", skip_serializing_if = "Option::is_none")] - pub size: Option, - /// The page number. - #[serde(rename = "number", skip_serializing_if = "Option::is_none")] - pub number: Option, -} - -impl PetsExplodePostPageExplodeParameter { - pub fn new() -> PetsExplodePostPageExplodeParameter { - PetsExplodePostPageExplodeParameter { - size: None, - number: None, - } - } -} - diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/_pets_explode_post_page_parameter.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/_pets_explode_post_page_parameter.rs deleted file mode 100644 index 6a9d3bd2797d..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/_pets_explode_post_page_parameter.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 PetsExplodePostPageParameter { - /// The page size. - #[serde(rename = "size", skip_serializing_if = "Option::is_none")] - pub size: Option, - /// The page number. - #[serde(rename = "number", skip_serializing_if = "Option::is_none")] - pub number: Option, -} - -impl PetsExplodePostPageParameter { - pub fn new() -> PetsExplodePostPageParameter { - PetsExplodePostPageParameter { - size: None, - number: None, - } - } -} - diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/_tests_discriminator_duplicate_enums_get_200_response.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/_tests_discriminator_duplicate_enums_get_200_response.rs deleted file mode 100644 index 5f7776745949..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/_tests_discriminator_duplicate_enums_get_200_response.rs +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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(tag = "objectType")] -pub enum TestsDiscriminatorDuplicateEnumsGet200Response { - #[serde(rename="car")] - Vehicle { - #[serde(rename = "type")] - r#type: String, - #[serde(rename = "name")] - name: String, - #[serde(rename = "speed")] - speed: f64, - }, - #[serde(rename="student")] - PersonStudent { - #[serde(rename = "type")] - r#type: String, - #[serde(rename = "name")] - name: String, - #[serde(rename = "speed")] - speed: f64, - }, - #[serde(rename="teacher")] - PersonTeacher { - #[serde(rename = "type")] - r#type: String, - #[serde(rename = "name")] - name: String, - #[serde(rename = "speed")] - speed: f64, - }, -} - -impl Default for TestsDiscriminatorDuplicateEnumsGet200Response { - fn default() -> Self { - Self::Vehicle { - r#type: Default::default(), - name: Default::default(), - speed: Default::default(), - } - - } -} - - 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 deleted file mode 100644 index e1039b65bcf7..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/duplicate_one_of.rs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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/duplicate_test.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/duplicate_test.rs deleted file mode 100644 index a27e36772fc6..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/duplicate_test.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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 DuplicateTest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, -} - -impl DuplicateTest { - pub fn new() -> DuplicateTest { - DuplicateTest { - name: None, - } - } -} - diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/duplicatetest.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/duplicatetest.rs deleted file mode 100644 index f50f7b84ecbe..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/duplicatetest.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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 Duplicatetest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, -} - -impl Duplicatetest { - pub fn new() -> Duplicatetest { - Duplicatetest { - name: None, - } - } -} - 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 653d185cd8d7..277e6f130a45 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,10 +10,6 @@ pub mod baz; pub use self::baz::Baz; pub mod category; pub use self::category::Category; -pub mod duplicate_test; -pub use self::duplicate_test::DuplicateTest; -pub mod duplicatetest; -pub use self::duplicatetest::Duplicatetest; pub mod enum_array_testing; pub use self::enum_array_testing::EnumArrayTesting; pub mod nullable_array; @@ -40,8 +36,6 @@ pub mod tag; pub use self::tag::Tag; pub mod test_all_of_with_multi_metadata_only; pub use self::test_all_of_with_multi_metadata_only::TestAllOfWithMultiMetadataOnly; -pub mod _tests_discriminator_duplicate_enums_get_200_response; -pub use self::_tests_discriminator_duplicate_enums_get_200_response::TestsDiscriminatorDuplicateEnumsGet200Response; pub mod type_testing; pub use self::type_testing::TypeTesting; pub mod unique_item_array_testing; 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 deleted file mode 100644 index 26ed4ce5f116..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/with_inner_one_of_foo.rs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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 40cf3b75bc00..6f32de967eaa 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,8 +8,6 @@ docs/ApiResponse.md docs/ArrayItemRefTest.md docs/Baz.md docs/Category.md -docs/DuplicateTest.md -docs/Duplicatetest.md docs/EnumArrayTesting.md docs/FakeApi.md docs/NullableArray.md @@ -27,7 +25,6 @@ docs/StoreApi.md docs/Tag.md docs/TestAllOfWithMultiMetadataOnly.md docs/TestingApi.md -docs/TestsDiscriminatorDuplicateEnumsGet200Response.md docs/TypeTesting.md docs/UniqueItemArrayTesting.md docs/User.md @@ -43,15 +40,12 @@ src/apis/store_api.rs src/apis/testing_api.rs src/apis/user_api.rs src/lib.rs -src/models/_tests_discriminator_duplicate_enums_get_200_response.rs src/models/action_container.rs src/models/any_type_test.rs src/models/api_response.rs src/models/array_item_ref_test.rs src/models/baz.rs src/models/category.rs -src/models/duplicate_test.rs -src/models/duplicatetest.rs src/models/enum_array_testing.rs src/models/mod.rs src/models/model_ref.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 b4d5de8c325b..fce23d27e7d9 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/README.md +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/README.md @@ -42,7 +42,6 @@ Class | Method | HTTP request | Description *StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID *StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet *TestingApi* | [**tests_all_of_with_one_model_get**](docs/TestingApi.md#tests_all_of_with_one_model_get) | **GET** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) -*TestingApi* | [**tests_discriminator_duplicate_enums_get**](docs/TestingApi.md#tests_discriminator_duplicate_enums_get) | **GET** /tests/discriminatorDuplicateEnums | Test for duplicate enums when using discriminator. (One of the issues in #20500) *TestingApi* | [**tests_file_response_get**](docs/TestingApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file *TestingApi* | [**tests_type_testing_get**](docs/TestingApi.md#tests_type_testing_get) | **GET** /tests/typeTesting | Route to test the TypeTesting schema *UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user @@ -63,8 +62,6 @@ Class | Method | HTTP request | Description - [ArrayItemRefTest](docs/ArrayItemRefTest.md) - [Baz](docs/Baz.md) - [Category](docs/Category.md) - - [DuplicateTest](docs/DuplicateTest.md) - - [Duplicatetest](docs/Duplicatetest.md) - [EnumArrayTesting](docs/EnumArrayTesting.md) - [NullableArray](docs/NullableArray.md) - [NumericEnumTesting](docs/NumericEnumTesting.md) @@ -78,7 +75,6 @@ Class | Method | HTTP request | Description - [Return](docs/Return.md) - [Tag](docs/Tag.md) - [TestAllOfWithMultiMetadataOnly](docs/TestAllOfWithMultiMetadataOnly.md) - - [TestsDiscriminatorDuplicateEnumsGet200Response](docs/TestsDiscriminatorDuplicateEnumsGet200Response.md) - [TypeTesting](docs/TypeTesting.md) - [UniqueItemArrayTesting](docs/UniqueItemArrayTesting.md) - [User](docs/User.md) 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 deleted file mode 100644 index 22b6b00f001b..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/DuplicateOneOf.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/DuplicateTest.md b/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/DuplicateTest.md deleted file mode 100644 index b9dd67677d29..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/DuplicateTest.md +++ /dev/null @@ -1,11 +0,0 @@ -# DuplicateTest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | Option<**String**> | | [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/Duplicatetest.md b/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/Duplicatetest.md deleted file mode 100644 index dab029dbf559..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/Duplicatetest.md +++ /dev/null @@ -1,11 +0,0 @@ -# Duplicatetest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | Option<**String**> | | [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/PetsExplodePostPageExplodeParameter.md b/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/PetsExplodePostPageExplodeParameter.md deleted file mode 100644 index 4d328f64458c..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/PetsExplodePostPageExplodeParameter.md +++ /dev/null @@ -1,12 +0,0 @@ -# PetsExplodePostPageExplodeParameter - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**size** | Option<**i64**> | The page size. | [optional][default to 10] -**number** | Option<**i64**> | The page number. | [optional][default to 1] - -[[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/PetsExplodePostPageParameter.md b/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/PetsExplodePostPageParameter.md deleted file mode 100644 index feef5fcabd79..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/PetsExplodePostPageParameter.md +++ /dev/null @@ -1,12 +0,0 @@ -# PetsExplodePostPageParameter - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**size** | Option<**i64**> | The page size. | [optional][default to 10] -**number** | Option<**i64**> | The page number. | [optional][default to 1] - -[[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/TestingApi.md b/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/TestingApi.md index 5439986dd2b1..a99edf6ffea8 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/TestingApi.md +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/TestingApi.md @@ -5,7 +5,6 @@ All URIs are relative to *http://petstore.swagger.io/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**tests_all_of_with_one_model_get**](TestingApi.md#tests_all_of_with_one_model_get) | **GET** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) -[**tests_discriminator_duplicate_enums_get**](TestingApi.md#tests_discriminator_duplicate_enums_get) | **GET** /tests/discriminatorDuplicateEnums | Test for duplicate enums when using discriminator. (One of the issues in #20500) [**tests_file_response_get**](TestingApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file [**tests_type_testing_get**](TestingApi.md#tests_type_testing_get) | **GET** /tests/typeTesting | Route to test the TypeTesting schema @@ -39,31 +38,6 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## tests_discriminator_duplicate_enums_get - -> models::TestsDiscriminatorDuplicateEnumsGet200Response tests_discriminator_duplicate_enums_get() -Test for duplicate enums when using discriminator. (One of the issues in #20500) - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::TestsDiscriminatorDuplicateEnumsGet200Response**](_tests_discriminatorDuplicateEnums_get_200_response.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - ## tests_file_response_get > std::path::PathBuf tests_file_response_get() diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/TestsDiscriminatorDuplicateEnumsGet200Response.md b/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/TestsDiscriminatorDuplicateEnumsGet200Response.md deleted file mode 100644 index 437935824565..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/TestsDiscriminatorDuplicateEnumsGet200Response.md +++ /dev/null @@ -1,10 +0,0 @@ -# TestsDiscriminatorDuplicateEnumsGet200Response - -## Enum Variants - -| Name | Value | -|---- | -----| - -[[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 deleted file mode 100644 index fcf524123aca..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/WithInnerOneOfFoo.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/apis/testing_api.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/testing_api.rs index a6ac53846f29..0a8e733d6cf7 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/testing_api.rs @@ -29,14 +29,6 @@ pub enum TestsAllOfWithOneModelGetSuccess { UnknownValue(serde_json::Value), } -/// struct for typed successes of method [`tests_discriminator_duplicate_enums_get`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum TestsDiscriminatorDuplicateEnumsGetSuccess { - Status200(models::TestsDiscriminatorDuplicateEnumsGet200Response), - UnknownValue(serde_json::Value), -} - /// struct for typed successes of method [`tests_file_response_get`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -60,13 +52,6 @@ pub enum TestsAllOfWithOneModelGetError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`tests_discriminator_duplicate_enums_get`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum TestsDiscriminatorDuplicateEnumsGetError { - UnknownValue(serde_json::Value), -} - /// struct for typed errors of method [`tests_file_response_get`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -108,31 +93,6 @@ pub async fn tests_all_of_with_one_model_get(configuration: &configuration::Conf } } -pub async fn tests_discriminator_duplicate_enums_get(configuration: &configuration::Configuration) -> Result, Error> { - - let uri_str = format!("{}/tests/discriminatorDuplicateEnums", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Ok(ResponseContent { status, content, entity }) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { status, content, entity })) - } -} - pub async fn tests_file_response_get(configuration: &configuration::Configuration) -> Result> { let uri_str = format!("{}/tests/fileResponse", configuration.base_path); diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/_pets_explode_post_page_explode_parameter.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/_pets_explode_post_page_explode_parameter.rs deleted file mode 100644 index 39367534b60b..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/_pets_explode_post_page_explode_parameter.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 PetsExplodePostPageExplodeParameter { - /// The page size. - #[serde(rename = "size", skip_serializing_if = "Option::is_none")] - pub size: Option, - /// The page number. - #[serde(rename = "number", skip_serializing_if = "Option::is_none")] - pub number: Option, -} - -impl PetsExplodePostPageExplodeParameter { - pub fn new() -> PetsExplodePostPageExplodeParameter { - PetsExplodePostPageExplodeParameter { - size: None, - number: None, - } - } -} - diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/_pets_explode_post_page_parameter.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/_pets_explode_post_page_parameter.rs deleted file mode 100644 index 6a9d3bd2797d..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/_pets_explode_post_page_parameter.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 PetsExplodePostPageParameter { - /// The page size. - #[serde(rename = "size", skip_serializing_if = "Option::is_none")] - pub size: Option, - /// The page number. - #[serde(rename = "number", skip_serializing_if = "Option::is_none")] - pub number: Option, -} - -impl PetsExplodePostPageParameter { - pub fn new() -> PetsExplodePostPageParameter { - PetsExplodePostPageParameter { - size: None, - number: None, - } - } -} - diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/_tests_discriminator_duplicate_enums_get_200_response.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/_tests_discriminator_duplicate_enums_get_200_response.rs deleted file mode 100644 index 5f7776745949..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/_tests_discriminator_duplicate_enums_get_200_response.rs +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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(tag = "objectType")] -pub enum TestsDiscriminatorDuplicateEnumsGet200Response { - #[serde(rename="car")] - Vehicle { - #[serde(rename = "type")] - r#type: String, - #[serde(rename = "name")] - name: String, - #[serde(rename = "speed")] - speed: f64, - }, - #[serde(rename="student")] - PersonStudent { - #[serde(rename = "type")] - r#type: String, - #[serde(rename = "name")] - name: String, - #[serde(rename = "speed")] - speed: f64, - }, - #[serde(rename="teacher")] - PersonTeacher { - #[serde(rename = "type")] - r#type: String, - #[serde(rename = "name")] - name: String, - #[serde(rename = "speed")] - speed: f64, - }, -} - -impl Default for TestsDiscriminatorDuplicateEnumsGet200Response { - fn default() -> Self { - Self::Vehicle { - r#type: Default::default(), - name: Default::default(), - speed: Default::default(), - } - - } -} - - 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 deleted file mode 100644 index 383d72228121..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/duplicate_one_of.rs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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/duplicate_test.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/duplicate_test.rs deleted file mode 100644 index a27e36772fc6..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/duplicate_test.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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 DuplicateTest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, -} - -impl DuplicateTest { - pub fn new() -> DuplicateTest { - DuplicateTest { - name: None, - } - } -} - diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/duplicatetest.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/duplicatetest.rs deleted file mode 100644 index f50f7b84ecbe..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/duplicatetest.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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 Duplicatetest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, -} - -impl Duplicatetest { - pub fn new() -> Duplicatetest { - Duplicatetest { - name: None, - } - } -} - 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 653d185cd8d7..277e6f130a45 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,10 +10,6 @@ pub mod baz; pub use self::baz::Baz; pub mod category; pub use self::category::Category; -pub mod duplicate_test; -pub use self::duplicate_test::DuplicateTest; -pub mod duplicatetest; -pub use self::duplicatetest::Duplicatetest; pub mod enum_array_testing; pub use self::enum_array_testing::EnumArrayTesting; pub mod nullable_array; @@ -40,8 +36,6 @@ pub mod tag; pub use self::tag::Tag; pub mod test_all_of_with_multi_metadata_only; pub use self::test_all_of_with_multi_metadata_only::TestAllOfWithMultiMetadataOnly; -pub mod _tests_discriminator_duplicate_enums_get_200_response; -pub use self::_tests_discriminator_duplicate_enums_get_200_response::TestsDiscriminatorDuplicateEnumsGet200Response; pub mod type_testing; pub use self::type_testing::TypeTesting; pub mod unique_item_array_testing; 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 deleted file mode 100644 index a0263960c69b..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/with_inner_one_of_foo.rs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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 40cf3b75bc00..6f32de967eaa 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/.openapi-generator/FILES +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/.openapi-generator/FILES @@ -8,8 +8,6 @@ docs/ApiResponse.md docs/ArrayItemRefTest.md docs/Baz.md docs/Category.md -docs/DuplicateTest.md -docs/Duplicatetest.md docs/EnumArrayTesting.md docs/FakeApi.md docs/NullableArray.md @@ -27,7 +25,6 @@ docs/StoreApi.md docs/Tag.md docs/TestAllOfWithMultiMetadataOnly.md docs/TestingApi.md -docs/TestsDiscriminatorDuplicateEnumsGet200Response.md docs/TypeTesting.md docs/UniqueItemArrayTesting.md docs/User.md @@ -43,15 +40,12 @@ src/apis/store_api.rs src/apis/testing_api.rs src/apis/user_api.rs src/lib.rs -src/models/_tests_discriminator_duplicate_enums_get_200_response.rs src/models/action_container.rs src/models/any_type_test.rs src/models/api_response.rs src/models/array_item_ref_test.rs src/models/baz.rs src/models/category.rs -src/models/duplicate_test.rs -src/models/duplicatetest.rs src/models/enum_array_testing.rs src/models/mod.rs src/models/model_ref.rs diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/README.md b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/README.md index d27cf59be360..ae82703eb842 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/README.md +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/README.md @@ -42,7 +42,6 @@ Class | Method | HTTP request | Description *StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID *StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet *TestingApi* | [**tests_all_of_with_one_model_get**](docs/TestingApi.md#tests_all_of_with_one_model_get) | **GET** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) -*TestingApi* | [**tests_discriminator_duplicate_enums_get**](docs/TestingApi.md#tests_discriminator_duplicate_enums_get) | **GET** /tests/discriminatorDuplicateEnums | Test for duplicate enums when using discriminator. (One of the issues in #20500) *TestingApi* | [**tests_file_response_get**](docs/TestingApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file *TestingApi* | [**tests_type_testing_get**](docs/TestingApi.md#tests_type_testing_get) | **GET** /tests/typeTesting | Route to test the TypeTesting schema *UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user @@ -63,8 +62,6 @@ Class | Method | HTTP request | Description - [ArrayItemRefTest](docs/ArrayItemRefTest.md) - [Baz](docs/Baz.md) - [Category](docs/Category.md) - - [DuplicateTest](docs/DuplicateTest.md) - - [Duplicatetest](docs/Duplicatetest.md) - [EnumArrayTesting](docs/EnumArrayTesting.md) - [NullableArray](docs/NullableArray.md) - [NumericEnumTesting](docs/NumericEnumTesting.md) @@ -78,7 +75,6 @@ Class | Method | HTTP request | Description - [Return](docs/Return.md) - [Tag](docs/Tag.md) - [TestAllOfWithMultiMetadataOnly](docs/TestAllOfWithMultiMetadataOnly.md) - - [TestsDiscriminatorDuplicateEnumsGet200Response](docs/TestsDiscriminatorDuplicateEnumsGet200Response.md) - [TypeTesting](docs/TypeTesting.md) - [UniqueItemArrayTesting](docs/UniqueItemArrayTesting.md) - [User](docs/User.md) diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/DuplicateOneOf.md b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/DuplicateOneOf.md deleted file mode 100644 index 22b6b00f001b..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/DuplicateOneOf.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/DuplicateTest.md b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/DuplicateTest.md deleted file mode 100644 index b9dd67677d29..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/DuplicateTest.md +++ /dev/null @@ -1,11 +0,0 @@ -# DuplicateTest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | Option<**String**> | | [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/Duplicatetest.md b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/Duplicatetest.md deleted file mode 100644 index dab029dbf559..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/Duplicatetest.md +++ /dev/null @@ -1,11 +0,0 @@ -# Duplicatetest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | Option<**String**> | | [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/PetsExplodePostPageExplodeParameter.md b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/PetsExplodePostPageExplodeParameter.md deleted file mode 100644 index 4d328f64458c..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/PetsExplodePostPageExplodeParameter.md +++ /dev/null @@ -1,12 +0,0 @@ -# PetsExplodePostPageExplodeParameter - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**size** | Option<**i64**> | The page size. | [optional][default to 10] -**number** | Option<**i64**> | The page number. | [optional][default to 1] - -[[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/PetsExplodePostPageParameter.md b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/PetsExplodePostPageParameter.md deleted file mode 100644 index feef5fcabd79..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/PetsExplodePostPageParameter.md +++ /dev/null @@ -1,12 +0,0 @@ -# PetsExplodePostPageParameter - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**size** | Option<**i64**> | The page size. | [optional][default to 10] -**number** | Option<**i64**> | The page number. | [optional][default to 1] - -[[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/TestingApi.md b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/TestingApi.md index 5439986dd2b1..a99edf6ffea8 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/TestingApi.md +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/TestingApi.md @@ -5,7 +5,6 @@ All URIs are relative to *http://petstore.swagger.io/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**tests_all_of_with_one_model_get**](TestingApi.md#tests_all_of_with_one_model_get) | **GET** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) -[**tests_discriminator_duplicate_enums_get**](TestingApi.md#tests_discriminator_duplicate_enums_get) | **GET** /tests/discriminatorDuplicateEnums | Test for duplicate enums when using discriminator. (One of the issues in #20500) [**tests_file_response_get**](TestingApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file [**tests_type_testing_get**](TestingApi.md#tests_type_testing_get) | **GET** /tests/typeTesting | Route to test the TypeTesting schema @@ -39,31 +38,6 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## tests_discriminator_duplicate_enums_get - -> models::TestsDiscriminatorDuplicateEnumsGet200Response tests_discriminator_duplicate_enums_get() -Test for duplicate enums when using discriminator. (One of the issues in #20500) - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::TestsDiscriminatorDuplicateEnumsGet200Response**](_tests_discriminatorDuplicateEnums_get_200_response.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - ## tests_file_response_get > std::path::PathBuf tests_file_response_get() diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/TestsDiscriminatorDuplicateEnumsGet200Response.md b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/TestsDiscriminatorDuplicateEnumsGet200Response.md deleted file mode 100644 index 437935824565..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/TestsDiscriminatorDuplicateEnumsGet200Response.md +++ /dev/null @@ -1,10 +0,0 @@ -# TestsDiscriminatorDuplicateEnumsGet200Response - -## Enum Variants - -| Name | Value | -|---- | -----| - -[[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 deleted file mode 100644 index fcf524123aca..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/WithInnerOneOfFoo.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/apis/testing_api.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/testing_api.rs index 448ed8a143c7..682abb339214 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/testing_api.rs @@ -22,13 +22,6 @@ pub enum TestsAllOfWithOneModelGetError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`tests_discriminator_duplicate_enums_get`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum TestsDiscriminatorDuplicateEnumsGetError { - UnknownValue(serde_json::Value), -} - /// struct for typed errors of method [`tests_file_response_get`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -81,40 +74,6 @@ pub fn tests_all_of_with_one_model_get(configuration: &configuration::Configurat } } -pub fn tests_discriminator_duplicate_enums_get(configuration: &configuration::Configuration, ) -> Result> { - - let uri_str = format!("{}/tests/discriminatorDuplicateEnums", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - - let req = req_builder.build()?; - let resp = configuration.client.execute(req)?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text()?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TestsDiscriminatorDuplicateEnumsGet200Response`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TestsDiscriminatorDuplicateEnumsGet200Response`")))), - } - } else { - let content = resp.text()?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { status, content, entity })) - } -} - pub fn tests_file_response_get(configuration: &configuration::Configuration, ) -> Result> { let uri_str = format!("{}/tests/fileResponse", configuration.base_path); diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/_pets_explode_post_page_explode_parameter.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/_pets_explode_post_page_explode_parameter.rs deleted file mode 100644 index 39367534b60b..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/_pets_explode_post_page_explode_parameter.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 PetsExplodePostPageExplodeParameter { - /// The page size. - #[serde(rename = "size", skip_serializing_if = "Option::is_none")] - pub size: Option, - /// The page number. - #[serde(rename = "number", skip_serializing_if = "Option::is_none")] - pub number: Option, -} - -impl PetsExplodePostPageExplodeParameter { - pub fn new() -> PetsExplodePostPageExplodeParameter { - PetsExplodePostPageExplodeParameter { - size: None, - number: None, - } - } -} - diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/_pets_explode_post_page_parameter.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/_pets_explode_post_page_parameter.rs deleted file mode 100644 index 6a9d3bd2797d..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/_pets_explode_post_page_parameter.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 PetsExplodePostPageParameter { - /// The page size. - #[serde(rename = "size", skip_serializing_if = "Option::is_none")] - pub size: Option, - /// The page number. - #[serde(rename = "number", skip_serializing_if = "Option::is_none")] - pub number: Option, -} - -impl PetsExplodePostPageParameter { - pub fn new() -> PetsExplodePostPageParameter { - PetsExplodePostPageParameter { - size: None, - number: None, - } - } -} - diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/_tests_discriminator_duplicate_enums_get_200_response.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/_tests_discriminator_duplicate_enums_get_200_response.rs deleted file mode 100644 index 5f7776745949..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/_tests_discriminator_duplicate_enums_get_200_response.rs +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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(tag = "objectType")] -pub enum TestsDiscriminatorDuplicateEnumsGet200Response { - #[serde(rename="car")] - Vehicle { - #[serde(rename = "type")] - r#type: String, - #[serde(rename = "name")] - name: String, - #[serde(rename = "speed")] - speed: f64, - }, - #[serde(rename="student")] - PersonStudent { - #[serde(rename = "type")] - r#type: String, - #[serde(rename = "name")] - name: String, - #[serde(rename = "speed")] - speed: f64, - }, - #[serde(rename="teacher")] - PersonTeacher { - #[serde(rename = "type")] - r#type: String, - #[serde(rename = "name")] - name: String, - #[serde(rename = "speed")] - speed: f64, - }, -} - -impl Default for TestsDiscriminatorDuplicateEnumsGet200Response { - fn default() -> Self { - Self::Vehicle { - r#type: Default::default(), - name: Default::default(), - speed: Default::default(), - } - - } -} - - 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 deleted file mode 100644 index e1039b65bcf7..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/duplicate_one_of.rs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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/duplicate_test.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/duplicate_test.rs deleted file mode 100644 index a27e36772fc6..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/duplicate_test.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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 DuplicateTest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, -} - -impl DuplicateTest { - pub fn new() -> DuplicateTest { - DuplicateTest { - name: None, - } - } -} - diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/duplicatetest.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/duplicatetest.rs deleted file mode 100644 index f50f7b84ecbe..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/duplicatetest.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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 Duplicatetest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, -} - -impl Duplicatetest { - pub fn new() -> Duplicatetest { - Duplicatetest { - name: None, - } - } -} - 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 653d185cd8d7..277e6f130a45 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,10 +10,6 @@ pub mod baz; pub use self::baz::Baz; pub mod category; pub use self::category::Category; -pub mod duplicate_test; -pub use self::duplicate_test::DuplicateTest; -pub mod duplicatetest; -pub use self::duplicatetest::Duplicatetest; pub mod enum_array_testing; pub use self::enum_array_testing::EnumArrayTesting; pub mod nullable_array; @@ -40,8 +36,6 @@ pub mod tag; pub use self::tag::Tag; pub mod test_all_of_with_multi_metadata_only; pub use self::test_all_of_with_multi_metadata_only::TestAllOfWithMultiMetadataOnly; -pub mod _tests_discriminator_duplicate_enums_get_200_response; -pub use self::_tests_discriminator_duplicate_enums_get_200_response::TestsDiscriminatorDuplicateEnumsGet200Response; pub mod type_testing; pub use self::type_testing::TypeTesting; pub mod unique_item_array_testing; 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 deleted file mode 100644 index 26ed4ce5f116..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/with_inner_one_of_foo.rs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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 37979799bb00..64b012eb8d81 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,8 +9,6 @@ docs/FooApiResponse.md docs/FooArrayItemRefTest.md docs/FooBaz.md docs/FooCategory.md -docs/FooDuplicateTest.md -docs/FooDuplicatetest.md docs/FooEnumArrayTesting.md docs/FooNullableArray.md docs/FooNumericEnumTesting.md @@ -24,7 +22,6 @@ docs/FooRef.md docs/FooReturn.md docs/FooTag.md docs/FooTestAllOfWithMultiMetadataOnly.md -docs/FooTestsDiscriminatorDuplicateEnumsGet200Response.md docs/FooTypeTesting.md docs/FooUniqueItemArrayTesting.md docs/FooUser.md @@ -43,15 +40,12 @@ src/apis/store_api.rs src/apis/testing_api.rs src/apis/user_api.rs src/lib.rs -src/models/foo__tests_discriminator_duplicate_enums_get_200_response.rs src/models/foo_action_container.rs src/models/foo_any_type_test.rs 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_test.rs -src/models/foo_duplicatetest.rs src/models/foo_enum_array_testing.rs src/models/foo_nullable_array.rs src/models/foo_numeric_enum_testing.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 2521f1282718..7a6adc58c775 100644 --- a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/README.md +++ b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/README.md @@ -42,7 +42,6 @@ Class | Method | HTTP request | Description *StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID *StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet *TestingApi* | [**tests_all_of_with_one_model_get**](docs/TestingApi.md#tests_all_of_with_one_model_get) | **GET** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) -*TestingApi* | [**tests_discriminator_duplicate_enums_get**](docs/TestingApi.md#tests_discriminator_duplicate_enums_get) | **GET** /tests/discriminatorDuplicateEnums | Test for duplicate enums when using discriminator. (One of the issues in #20500) *TestingApi* | [**tests_file_response_get**](docs/TestingApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file *TestingApi* | [**tests_type_testing_get**](docs/TestingApi.md#tests_type_testing_get) | **GET** /tests/typeTesting | Route to test the TypeTesting schema *UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user @@ -63,8 +62,6 @@ Class | Method | HTTP request | Description - [FooArrayItemRefTest](docs/FooArrayItemRefTest.md) - [FooBaz](docs/FooBaz.md) - [FooCategory](docs/FooCategory.md) - - [FooDuplicateTest](docs/FooDuplicateTest.md) - - [FooDuplicatetest](docs/FooDuplicatetest.md) - [FooEnumArrayTesting](docs/FooEnumArrayTesting.md) - [FooNullableArray](docs/FooNullableArray.md) - [FooNumericEnumTesting](docs/FooNumericEnumTesting.md) @@ -78,7 +75,6 @@ Class | Method | HTTP request | Description - [FooReturn](docs/FooReturn.md) - [FooTag](docs/FooTag.md) - [FooTestAllOfWithMultiMetadataOnly](docs/FooTestAllOfWithMultiMetadataOnly.md) - - [FooTestsDiscriminatorDuplicateEnumsGet200Response](docs/FooTestsDiscriminatorDuplicateEnumsGet200Response.md) - [FooTypeTesting](docs/FooTypeTesting.md) - [FooUniqueItemArrayTesting](docs/FooUniqueItemArrayTesting.md) - [FooUser](docs/FooUser.md) 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 deleted file mode 100644 index 4211ad2165bf..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/FooDuplicateOneOf.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/FooDuplicateTest.md b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/FooDuplicateTest.md deleted file mode 100644 index a8c013902bc0..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/FooDuplicateTest.md +++ /dev/null @@ -1,11 +0,0 @@ -# FooDuplicateTest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | Option<**String**> | | [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/FooDuplicatetest.md b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/FooDuplicatetest.md deleted file mode 100644 index 9d373ccabc2f..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/FooDuplicatetest.md +++ /dev/null @@ -1,11 +0,0 @@ -# FooDuplicatetest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | Option<**String**> | | [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/FooPetsExplodePostPageExplodeParameter.md b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/FooPetsExplodePostPageExplodeParameter.md deleted file mode 100644 index 99b9910675a3..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/FooPetsExplodePostPageExplodeParameter.md +++ /dev/null @@ -1,12 +0,0 @@ -# FooPetsExplodePostPageExplodeParameter - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**size** | Option<**i64**> | The page size. | [optional][default to 10] -**number** | Option<**i64**> | The page number. | [optional][default to 1] - -[[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/FooPetsExplodePostPageParameter.md b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/FooPetsExplodePostPageParameter.md deleted file mode 100644 index 0d2b7d8f2605..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/FooPetsExplodePostPageParameter.md +++ /dev/null @@ -1,12 +0,0 @@ -# FooPetsExplodePostPageParameter - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**size** | Option<**i64**> | The page size. | [optional][default to 10] -**number** | Option<**i64**> | The page number. | [optional][default to 1] - -[[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/FooTestsDiscriminatorDuplicateEnumsGet200Response.md b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/FooTestsDiscriminatorDuplicateEnumsGet200Response.md deleted file mode 100644 index 7d3e59af3141..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/FooTestsDiscriminatorDuplicateEnumsGet200Response.md +++ /dev/null @@ -1,10 +0,0 @@ -# FooTestsDiscriminatorDuplicateEnumsGet200Response - -## Enum Variants - -| Name | Value | -|---- | -----| - -[[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 deleted file mode 100644 index ab75509a1964..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/FooWithInnerOneOfFoo.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/docs/TestingApi.md b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/TestingApi.md index 27c0de6b57e8..dfb0b97642bf 100644 --- a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/TestingApi.md +++ b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/docs/TestingApi.md @@ -5,7 +5,6 @@ All URIs are relative to *http://petstore.swagger.io/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**tests_all_of_with_one_model_get**](TestingApi.md#tests_all_of_with_one_model_get) | **GET** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) -[**tests_discriminator_duplicate_enums_get**](TestingApi.md#tests_discriminator_duplicate_enums_get) | **GET** /tests/discriminatorDuplicateEnums | Test for duplicate enums when using discriminator. (One of the issues in #20500) [**tests_file_response_get**](TestingApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file [**tests_type_testing_get**](TestingApi.md#tests_type_testing_get) | **GET** /tests/typeTesting | Route to test the TypeTesting schema @@ -39,31 +38,6 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## tests_discriminator_duplicate_enums_get - -> models::FooTestsDiscriminatorDuplicateEnumsGet200Response tests_discriminator_duplicate_enums_get() -Test for duplicate enums when using discriminator. (One of the issues in #20500) - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::FooTestsDiscriminatorDuplicateEnumsGet200Response**](_tests_discriminatorDuplicateEnums_get_200_response.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - ## tests_file_response_get > std::path::PathBuf tests_file_response_get() diff --git a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/apis/testing_api.rs b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/apis/testing_api.rs index 24b370c6d156..186924c77f47 100644 --- a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/apis/testing_api.rs @@ -22,13 +22,6 @@ pub enum TestsAllOfWithOneModelGetError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`tests_discriminator_duplicate_enums_get`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum TestsDiscriminatorDuplicateEnumsGetError { - UnknownValue(serde_json::Value), -} - /// struct for typed errors of method [`tests_file_response_get`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -81,40 +74,6 @@ pub fn tests_all_of_with_one_model_get(configuration: &configuration::Configurat } } -pub fn tests_discriminator_duplicate_enums_get(configuration: &configuration::Configuration, ) -> Result> { - - let uri_str = format!("{}/tests/discriminatorDuplicateEnums", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - - let req = req_builder.build()?; - let resp = configuration.client.execute(req)?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text()?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FooTestsDiscriminatorDuplicateEnumsGet200Response`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::FooTestsDiscriminatorDuplicateEnumsGet200Response`")))), - } - } else { - let content = resp.text()?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { status, content, entity })) - } -} - pub fn tests_file_response_get(configuration: &configuration::Configuration, ) -> Result> { let uri_str = format!("{}/tests/fileResponse", configuration.base_path); diff --git a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/foo__pets_explode_post_page_explode_parameter.rs b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/foo__pets_explode_post_page_explode_parameter.rs deleted file mode 100644 index e35b41189b84..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/foo__pets_explode_post_page_explode_parameter.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 FooPetsExplodePostPageExplodeParameter { - /// The page size. - #[serde(rename = "size", skip_serializing_if = "Option::is_none")] - pub size: Option, - /// The page number. - #[serde(rename = "number", skip_serializing_if = "Option::is_none")] - pub number: Option, -} - -impl FooPetsExplodePostPageExplodeParameter { - pub fn new() -> FooPetsExplodePostPageExplodeParameter { - FooPetsExplodePostPageExplodeParameter { - size: None, - number: None, - } - } -} - diff --git a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/foo__pets_explode_post_page_parameter.rs b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/foo__pets_explode_post_page_parameter.rs deleted file mode 100644 index 393d60a6e885..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/foo__pets_explode_post_page_parameter.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 FooPetsExplodePostPageParameter { - /// The page size. - #[serde(rename = "size", skip_serializing_if = "Option::is_none")] - pub size: Option, - /// The page number. - #[serde(rename = "number", skip_serializing_if = "Option::is_none")] - pub number: Option, -} - -impl FooPetsExplodePostPageParameter { - pub fn new() -> FooPetsExplodePostPageParameter { - FooPetsExplodePostPageParameter { - size: None, - number: None, - } - } -} - diff --git a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/foo__tests_discriminator_duplicate_enums_get_200_response.rs b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/foo__tests_discriminator_duplicate_enums_get_200_response.rs deleted file mode 100644 index 10653b9911ae..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/foo__tests_discriminator_duplicate_enums_get_200_response.rs +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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(tag = "objectType")] -pub enum FooTestsDiscriminatorDuplicateEnumsGet200Response { - #[serde(rename="car")] - FooVehicle { - #[serde(rename = "type")] - r#type: String, - #[serde(rename = "name")] - name: String, - #[serde(rename = "speed")] - speed: f64, - }, - #[serde(rename="student")] - FooPersonStudent { - #[serde(rename = "type")] - r#type: String, - #[serde(rename = "name")] - name: String, - #[serde(rename = "speed")] - speed: f64, - }, - #[serde(rename="teacher")] - FooPersonTeacher { - #[serde(rename = "type")] - r#type: String, - #[serde(rename = "name")] - name: String, - #[serde(rename = "speed")] - speed: f64, - }, -} - -impl Default for FooTestsDiscriminatorDuplicateEnumsGet200Response { - fn default() -> Self { - Self::FooVehicle { - r#type: Default::default(), - name: Default::default(), - speed: Default::default(), - } - - } -} - - 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 deleted file mode 100644 index 088a6056eea9..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/foo_duplicate_one_of.rs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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_duplicate_test.rs b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/foo_duplicate_test.rs deleted file mode 100644 index 8c2465516b26..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/foo_duplicate_test.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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 FooDuplicateTest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, -} - -impl FooDuplicateTest { - pub fn new() -> FooDuplicateTest { - FooDuplicateTest { - name: None, - } - } -} - diff --git a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/foo_duplicatetest.rs b/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/foo_duplicatetest.rs deleted file mode 100644 index cb03e3cdb9d9..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/foo_duplicatetest.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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 FooDuplicatetest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, -} - -impl FooDuplicatetest { - pub fn new() -> FooDuplicatetest { - FooDuplicatetest { - name: 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 deleted file mode 100644 index 8dea145e3983..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore-model-name-prefix/src/models/foo_with_inner_one_of_foo.rs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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 a3ff8aa53530..ee04b2836dcb 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,10 +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_test; -pub use self::foo_duplicate_test::FooDuplicateTest; -pub mod foo_duplicatetest; -pub use self::foo_duplicatetest::FooDuplicatetest; pub mod foo_enum_array_testing; pub use self::foo_enum_array_testing::FooEnumArrayTesting; pub mod foo_nullable_array; @@ -40,8 +36,6 @@ pub mod foo_tag; pub use self::foo_tag::FooTag; pub mod foo_test_all_of_with_multi_metadata_only; pub use self::foo_test_all_of_with_multi_metadata_only::FooTestAllOfWithMultiMetadataOnly; -pub mod foo__tests_discriminator_duplicate_enums_get_200_response; -pub use self::foo__tests_discriminator_duplicate_enums_get_200_response::FooTestsDiscriminatorDuplicateEnumsGet200Response; pub mod foo_type_testing; pub use self::foo_type_testing::FooTypeTesting; pub mod foo_unique_item_array_testing; diff --git a/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/FILES b/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/FILES index 40cf3b75bc00..6f32de967eaa 100644 --- a/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/FILES +++ b/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/FILES @@ -8,8 +8,6 @@ docs/ApiResponse.md docs/ArrayItemRefTest.md docs/Baz.md docs/Category.md -docs/DuplicateTest.md -docs/Duplicatetest.md docs/EnumArrayTesting.md docs/FakeApi.md docs/NullableArray.md @@ -27,7 +25,6 @@ docs/StoreApi.md docs/Tag.md docs/TestAllOfWithMultiMetadataOnly.md docs/TestingApi.md -docs/TestsDiscriminatorDuplicateEnumsGet200Response.md docs/TypeTesting.md docs/UniqueItemArrayTesting.md docs/User.md @@ -43,15 +40,12 @@ src/apis/store_api.rs src/apis/testing_api.rs src/apis/user_api.rs src/lib.rs -src/models/_tests_discriminator_duplicate_enums_get_200_response.rs src/models/action_container.rs src/models/any_type_test.rs src/models/api_response.rs src/models/array_item_ref_test.rs src/models/baz.rs src/models/category.rs -src/models/duplicate_test.rs -src/models/duplicatetest.rs src/models/enum_array_testing.rs src/models/mod.rs src/models/model_ref.rs diff --git a/samples/client/petstore/rust/reqwest/petstore/README.md b/samples/client/petstore/rust/reqwest/petstore/README.md index 1f758b389832..4de25c0d492e 100644 --- a/samples/client/petstore/rust/reqwest/petstore/README.md +++ b/samples/client/petstore/rust/reqwest/petstore/README.md @@ -42,7 +42,6 @@ Class | Method | HTTP request | Description *StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID *StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet *TestingApi* | [**tests_all_of_with_one_model_get**](docs/TestingApi.md#tests_all_of_with_one_model_get) | **GET** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) -*TestingApi* | [**tests_discriminator_duplicate_enums_get**](docs/TestingApi.md#tests_discriminator_duplicate_enums_get) | **GET** /tests/discriminatorDuplicateEnums | Test for duplicate enums when using discriminator. (One of the issues in #20500) *TestingApi* | [**tests_file_response_get**](docs/TestingApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file *TestingApi* | [**tests_type_testing_get**](docs/TestingApi.md#tests_type_testing_get) | **GET** /tests/typeTesting | Route to test the TypeTesting schema *UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user @@ -63,8 +62,6 @@ Class | Method | HTTP request | Description - [ArrayItemRefTest](docs/ArrayItemRefTest.md) - [Baz](docs/Baz.md) - [Category](docs/Category.md) - - [DuplicateTest](docs/DuplicateTest.md) - - [Duplicatetest](docs/Duplicatetest.md) - [EnumArrayTesting](docs/EnumArrayTesting.md) - [NullableArray](docs/NullableArray.md) - [NumericEnumTesting](docs/NumericEnumTesting.md) @@ -78,7 +75,6 @@ Class | Method | HTTP request | Description - [Return](docs/Return.md) - [Tag](docs/Tag.md) - [TestAllOfWithMultiMetadataOnly](docs/TestAllOfWithMultiMetadataOnly.md) - - [TestsDiscriminatorDuplicateEnumsGet200Response](docs/TestsDiscriminatorDuplicateEnumsGet200Response.md) - [TypeTesting](docs/TypeTesting.md) - [UniqueItemArrayTesting](docs/UniqueItemArrayTesting.md) - [User](docs/User.md) diff --git a/samples/client/petstore/rust/reqwest/petstore/docs/DefaultApi.md b/samples/client/petstore/rust/reqwest/petstore/docs/DefaultApi.md deleted file mode 100644 index 86b9c86e7c99..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore/docs/DefaultApi.md +++ /dev/null @@ -1,60 +0,0 @@ -# \DefaultApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**tests_file_response_get**](DefaultApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file -[**tests_type_testing_get**](DefaultApi.md#tests_type_testing_get) | **GET** /tests/typeTesting | Route to test the TypeTesting schema - - - -## tests_file_response_get - -> std::path::PathBuf tests_file_response_get() -Returns an image file - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**std::path::PathBuf**](std::path::PathBuf.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: image/jpeg - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## tests_type_testing_get - -> crate::models::TypeTesting tests_type_testing_get() -Route to test the TypeTesting schema - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**crate::models::TypeTesting**](TypeTesting.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/rust/reqwest/petstore/docs/DuplicateOneOf.md b/samples/client/petstore/rust/reqwest/petstore/docs/DuplicateOneOf.md deleted file mode 100644 index 22b6b00f001b..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore/docs/DuplicateOneOf.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/DuplicateTest.md b/samples/client/petstore/rust/reqwest/petstore/docs/DuplicateTest.md deleted file mode 100644 index b9dd67677d29..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore/docs/DuplicateTest.md +++ /dev/null @@ -1,11 +0,0 @@ -# DuplicateTest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | Option<**String**> | | [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/Duplicatetest.md b/samples/client/petstore/rust/reqwest/petstore/docs/Duplicatetest.md deleted file mode 100644 index dab029dbf559..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore/docs/Duplicatetest.md +++ /dev/null @@ -1,11 +0,0 @@ -# Duplicatetest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | Option<**String**> | | [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/PetsExplodePostPageExplodeParameter.md b/samples/client/petstore/rust/reqwest/petstore/docs/PetsExplodePostPageExplodeParameter.md deleted file mode 100644 index 4d328f64458c..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore/docs/PetsExplodePostPageExplodeParameter.md +++ /dev/null @@ -1,12 +0,0 @@ -# PetsExplodePostPageExplodeParameter - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**size** | Option<**i64**> | The page size. | [optional][default to 10] -**number** | Option<**i64**> | The page number. | [optional][default to 1] - -[[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/PetsExplodePostPageParameter.md b/samples/client/petstore/rust/reqwest/petstore/docs/PetsExplodePostPageParameter.md deleted file mode 100644 index feef5fcabd79..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore/docs/PetsExplodePostPageParameter.md +++ /dev/null @@ -1,12 +0,0 @@ -# PetsExplodePostPageParameter - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**size** | Option<**i64**> | The page size. | [optional][default to 10] -**number** | Option<**i64**> | The page number. | [optional][default to 1] - -[[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/TestingApi.md b/samples/client/petstore/rust/reqwest/petstore/docs/TestingApi.md index 5439986dd2b1..a99edf6ffea8 100644 --- a/samples/client/petstore/rust/reqwest/petstore/docs/TestingApi.md +++ b/samples/client/petstore/rust/reqwest/petstore/docs/TestingApi.md @@ -5,7 +5,6 @@ All URIs are relative to *http://petstore.swagger.io/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**tests_all_of_with_one_model_get**](TestingApi.md#tests_all_of_with_one_model_get) | **GET** /tests/allOfWithOneModel | Test for allOf with a single option. (One of the issues in #20500) -[**tests_discriminator_duplicate_enums_get**](TestingApi.md#tests_discriminator_duplicate_enums_get) | **GET** /tests/discriminatorDuplicateEnums | Test for duplicate enums when using discriminator. (One of the issues in #20500) [**tests_file_response_get**](TestingApi.md#tests_file_response_get) | **GET** /tests/fileResponse | Returns an image file [**tests_type_testing_get**](TestingApi.md#tests_type_testing_get) | **GET** /tests/typeTesting | Route to test the TypeTesting schema @@ -39,31 +38,6 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## tests_discriminator_duplicate_enums_get - -> models::TestsDiscriminatorDuplicateEnumsGet200Response tests_discriminator_duplicate_enums_get() -Test for duplicate enums when using discriminator. (One of the issues in #20500) - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::TestsDiscriminatorDuplicateEnumsGet200Response**](_tests_discriminatorDuplicateEnums_get_200_response.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - ## tests_file_response_get > std::path::PathBuf tests_file_response_get() diff --git a/samples/client/petstore/rust/reqwest/petstore/docs/TestsDiscriminatorDuplicateEnumsGet200Response.md b/samples/client/petstore/rust/reqwest/petstore/docs/TestsDiscriminatorDuplicateEnumsGet200Response.md deleted file mode 100644 index 437935824565..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore/docs/TestsDiscriminatorDuplicateEnumsGet200Response.md +++ /dev/null @@ -1,10 +0,0 @@ -# TestsDiscriminatorDuplicateEnumsGet200Response - -## Enum Variants - -| Name | Value | -|---- | -----| - -[[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 deleted file mode 100644 index fcf524123aca..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore/docs/WithInnerOneOfFoo.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/apis/testing_api.rs b/samples/client/petstore/rust/reqwest/petstore/src/apis/testing_api.rs index 448ed8a143c7..682abb339214 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/apis/testing_api.rs @@ -22,13 +22,6 @@ pub enum TestsAllOfWithOneModelGetError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`tests_discriminator_duplicate_enums_get`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum TestsDiscriminatorDuplicateEnumsGetError { - UnknownValue(serde_json::Value), -} - /// struct for typed errors of method [`tests_file_response_get`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -81,40 +74,6 @@ pub fn tests_all_of_with_one_model_get(configuration: &configuration::Configurat } } -pub fn tests_discriminator_duplicate_enums_get(configuration: &configuration::Configuration, ) -> Result> { - - let uri_str = format!("{}/tests/discriminatorDuplicateEnums", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - - let req = req_builder.build()?; - let resp = configuration.client.execute(req)?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text()?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TestsDiscriminatorDuplicateEnumsGet200Response`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TestsDiscriminatorDuplicateEnumsGet200Response`")))), - } - } else { - let content = resp.text()?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { status, content, entity })) - } -} - pub fn tests_file_response_get(configuration: &configuration::Configuration, ) -> Result> { let uri_str = format!("{}/tests/fileResponse", configuration.base_path); diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/_pets_explode_post_page_explode_parameter.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/_pets_explode_post_page_explode_parameter.rs deleted file mode 100644 index 39367534b60b..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/_pets_explode_post_page_explode_parameter.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 PetsExplodePostPageExplodeParameter { - /// The page size. - #[serde(rename = "size", skip_serializing_if = "Option::is_none")] - pub size: Option, - /// The page number. - #[serde(rename = "number", skip_serializing_if = "Option::is_none")] - pub number: Option, -} - -impl PetsExplodePostPageExplodeParameter { - pub fn new() -> PetsExplodePostPageExplodeParameter { - PetsExplodePostPageExplodeParameter { - size: None, - number: None, - } - } -} - diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/_pets_explode_post_page_parameter.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/_pets_explode_post_page_parameter.rs deleted file mode 100644 index 6a9d3bd2797d..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/_pets_explode_post_page_parameter.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 PetsExplodePostPageParameter { - /// The page size. - #[serde(rename = "size", skip_serializing_if = "Option::is_none")] - pub size: Option, - /// The page number. - #[serde(rename = "number", skip_serializing_if = "Option::is_none")] - pub number: Option, -} - -impl PetsExplodePostPageParameter { - pub fn new() -> PetsExplodePostPageParameter { - PetsExplodePostPageParameter { - size: None, - number: None, - } - } -} - diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/_tests_discriminator_duplicate_enums_get_200_response.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/_tests_discriminator_duplicate_enums_get_200_response.rs deleted file mode 100644 index 5f7776745949..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/_tests_discriminator_duplicate_enums_get_200_response.rs +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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(tag = "objectType")] -pub enum TestsDiscriminatorDuplicateEnumsGet200Response { - #[serde(rename="car")] - Vehicle { - #[serde(rename = "type")] - r#type: String, - #[serde(rename = "name")] - name: String, - #[serde(rename = "speed")] - speed: f64, - }, - #[serde(rename="student")] - PersonStudent { - #[serde(rename = "type")] - r#type: String, - #[serde(rename = "name")] - name: String, - #[serde(rename = "speed")] - speed: f64, - }, - #[serde(rename="teacher")] - PersonTeacher { - #[serde(rename = "type")] - r#type: String, - #[serde(rename = "name")] - name: String, - #[serde(rename = "speed")] - speed: f64, - }, -} - -impl Default for TestsDiscriminatorDuplicateEnumsGet200Response { - fn default() -> Self { - Self::Vehicle { - r#type: Default::default(), - name: Default::default(), - speed: Default::default(), - } - - } -} - - 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 deleted file mode 100644 index ad47a777daec..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/duplicate_one_of.rs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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/duplicate_test.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/duplicate_test.rs deleted file mode 100644 index a27e36772fc6..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/duplicate_test.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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 DuplicateTest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, -} - -impl DuplicateTest { - pub fn new() -> DuplicateTest { - DuplicateTest { - name: None, - } - } -} - diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/duplicatetest.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/duplicatetest.rs deleted file mode 100644 index f50f7b84ecbe..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/duplicatetest.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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 Duplicatetest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, -} - -impl Duplicatetest { - pub fn new() -> Duplicatetest { - Duplicatetest { - name: None, - } - } -} - 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 653d185cd8d7..277e6f130a45 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/mod.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/mod.rs @@ -10,10 +10,6 @@ pub mod baz; pub use self::baz::Baz; pub mod category; pub use self::category::Category; -pub mod duplicate_test; -pub use self::duplicate_test::DuplicateTest; -pub mod duplicatetest; -pub use self::duplicatetest::Duplicatetest; pub mod enum_array_testing; pub use self::enum_array_testing::EnumArrayTesting; pub mod nullable_array; @@ -40,8 +36,6 @@ pub mod tag; pub use self::tag::Tag; pub mod test_all_of_with_multi_metadata_only; pub use self::test_all_of_with_multi_metadata_only::TestAllOfWithMultiMetadataOnly; -pub mod _tests_discriminator_duplicate_enums_get_200_response; -pub use self::_tests_discriminator_duplicate_enums_get_200_response::TestsDiscriminatorDuplicateEnumsGet200Response; pub mod type_testing; pub use self::type_testing::TypeTesting; pub mod unique_item_array_testing; 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 deleted file mode 100644 index 9917806aa62b..000000000000 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/with_inner_one_of_foo.rs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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/test-duplicates/.gitignore b/samples/client/petstore/rust/reqwest/test-duplicates/.gitignore new file mode 100644 index 000000000000..6aa106405a4b --- /dev/null +++ b/samples/client/petstore/rust/reqwest/test-duplicates/.gitignore @@ -0,0 +1,3 @@ +/target/ +**/*.rs.bk +Cargo.lock diff --git a/samples/client/petstore/rust/reqwest/test-duplicates/.openapi-generator-ignore b/samples/client/petstore/rust/reqwest/test-duplicates/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/test-duplicates/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/rust/reqwest/test-duplicates/.openapi-generator/FILES b/samples/client/petstore/rust/reqwest/test-duplicates/.openapi-generator/FILES new file mode 100644 index 000000000000..99fe292a54dc --- /dev/null +++ b/samples/client/petstore/rust/reqwest/test-duplicates/.openapi-generator/FILES @@ -0,0 +1,21 @@ +.gitignore +.travis.yml +Cargo.toml +README.md +docs/DuplicateTest.md +docs/Person.md +docs/TestingApi.md +docs/TestsDiscriminatorDuplicateEnumsGet200Response.md +docs/Vehicle.md +docs/another_test.md +git_push.sh +src/apis/configuration.rs +src/apis/mod.rs +src/apis/testing_api.rs +src/lib.rs +src/models/_tests_discriminator_duplicate_enums_get_200_response.rs +src/models/duplicate_test.rs +src/models/duplicatetest.rs +src/models/mod.rs +src/models/person.rs +src/models/vehicle.rs diff --git a/samples/client/petstore/rust/reqwest/test-duplicates/.openapi-generator/VERSION b/samples/client/petstore/rust/reqwest/test-duplicates/.openapi-generator/VERSION new file mode 100644 index 000000000000..4c631cf217a2 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/test-duplicates/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.14.0-SNAPSHOT diff --git a/samples/client/petstore/rust/reqwest/test-duplicates/.travis.yml b/samples/client/petstore/rust/reqwest/test-duplicates/.travis.yml new file mode 100644 index 000000000000..22761ba7ee19 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/test-duplicates/.travis.yml @@ -0,0 +1 @@ +language: rust diff --git a/samples/client/petstore/rust/reqwest/test-duplicates/Cargo.toml b/samples/client/petstore/rust/reqwest/test-duplicates/Cargo.toml new file mode 100644 index 000000000000..2f6e59f8b453 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/test-duplicates/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "test-duplicates-reqwest" +version = "1.0.0" +authors = ["OpenAPI Generator team and contributors"] +description = "To test duplicates" +license = "Apache-2.0" +edition = "2021" + +[dependencies] +serde = { version = "^1.0", features = ["derive"] } +serde_json = "^1.0" +serde_repr = "^0.1" +url = "^2.5" +reqwest = { version = "^0.12", default-features = false, features = ["json", "blocking", "multipart"] } diff --git a/samples/client/petstore/rust/reqwest/test-duplicates/README.md b/samples/client/petstore/rust/reqwest/test-duplicates/README.md new file mode 100644 index 000000000000..9cded36ef3ad --- /dev/null +++ b/samples/client/petstore/rust/reqwest/test-duplicates/README.md @@ -0,0 +1,50 @@ +# Rust API client for test-duplicates-reqwest + +To test duplicates + + +## Overview + +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: 1.0.0 +- Generator version: 7.14.0-SNAPSHOT +- Build package: `org.openapitools.codegen.languages.RustClientCodegen` + +## Installation + +Put the package under your project folder in a directory named `test-duplicates-reqwest` and add the following to `Cargo.toml` under `[dependencies]`: + +``` +test-duplicates-reqwest = { path = "./test-duplicates-reqwest" } +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*TestingApi* | [**tests_discriminator_duplicate_enums_get**](docs/TestingApi.md#tests_discriminator_duplicate_enums_get) | **GET** /tests/discriminatorDuplicateEnums | Test for duplicate enums when using discriminator. (One of the issues in #20500) + + +## Documentation For Models + + - [DuplicateTest](docs/DuplicateTest.md) + - [Person](docs/Person.md) + - [TestsDiscriminatorDuplicateEnumsGet200Response](docs/TestsDiscriminatorDuplicateEnumsGet200Response.md) + - [Vehicle](docs/Vehicle.md) + - [another_test](docs/another_test.md) + + +To get access to the crate's generated documentation, use: + +``` +cargo doc --open +``` + +## Author + + + diff --git a/samples/client/petstore/rust/hyper0x/petstore/docs/DuplicateTest.md b/samples/client/petstore/rust/reqwest/test-duplicates/docs/DuplicateTest.md similarity index 100% rename from samples/client/petstore/rust/hyper0x/petstore/docs/DuplicateTest.md rename to samples/client/petstore/rust/reqwest/test-duplicates/docs/DuplicateTest.md diff --git a/samples/client/petstore/rust/reqwest/test-duplicates/docs/Person.md b/samples/client/petstore/rust/reqwest/test-duplicates/docs/Person.md new file mode 100644 index 000000000000..20b43cc0345e --- /dev/null +++ b/samples/client/petstore/rust/reqwest/test-duplicates/docs/Person.md @@ -0,0 +1,12 @@ +# Person + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | **String** | | +**name** | **String** | | + +[[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/test-duplicates/docs/TestingApi.md b/samples/client/petstore/rust/reqwest/test-duplicates/docs/TestingApi.md new file mode 100644 index 000000000000..63fc1a54fe88 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/test-duplicates/docs/TestingApi.md @@ -0,0 +1,34 @@ +# \TestingApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**tests_discriminator_duplicate_enums_get**](TestingApi.md#tests_discriminator_duplicate_enums_get) | **GET** /tests/discriminatorDuplicateEnums | Test for duplicate enums when using discriminator. (One of the issues in #20500) + + + +## tests_discriminator_duplicate_enums_get + +> models::TestsDiscriminatorDuplicateEnumsGet200Response tests_discriminator_duplicate_enums_get() +Test for duplicate enums when using discriminator. (One of the issues in #20500) + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**models::TestsDiscriminatorDuplicateEnumsGet200Response**](_tests_discriminatorDuplicateEnums_get_200_response.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/rust/hyper0x/petstore/docs/TestsDiscriminatorDuplicateEnumsGet200Response.md b/samples/client/petstore/rust/reqwest/test-duplicates/docs/TestsDiscriminatorDuplicateEnumsGet200Response.md similarity index 100% rename from samples/client/petstore/rust/hyper0x/petstore/docs/TestsDiscriminatorDuplicateEnumsGet200Response.md rename to samples/client/petstore/rust/reqwest/test-duplicates/docs/TestsDiscriminatorDuplicateEnumsGet200Response.md diff --git a/samples/client/petstore/rust/reqwest-trait/petstore/docs/Duplicatetest.md b/samples/client/petstore/rust/reqwest/test-duplicates/docs/Vehicle.md similarity index 80% rename from samples/client/petstore/rust/reqwest-trait/petstore/docs/Duplicatetest.md rename to samples/client/petstore/rust/reqwest/test-duplicates/docs/Vehicle.md index dab029dbf559..1a4b48467fd6 100644 --- a/samples/client/petstore/rust/reqwest-trait/petstore/docs/Duplicatetest.md +++ b/samples/client/petstore/rust/reqwest/test-duplicates/docs/Vehicle.md @@ -1,10 +1,11 @@ -# Duplicatetest +# Vehicle ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | Option<**String**> | | [optional] +**r#type** | **String** | | +**speed** | **f64** | | [[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/Duplicatetest.md b/samples/client/petstore/rust/reqwest/test-duplicates/docs/another_test.md similarity index 95% rename from samples/client/petstore/rust/hyper0x/petstore/docs/Duplicatetest.md rename to samples/client/petstore/rust/reqwest/test-duplicates/docs/another_test.md index dab029dbf559..835bbb03ab5e 100644 --- a/samples/client/petstore/rust/hyper0x/petstore/docs/Duplicatetest.md +++ b/samples/client/petstore/rust/reqwest/test-duplicates/docs/another_test.md @@ -1,4 +1,4 @@ -# Duplicatetest +# another_test ## Properties diff --git a/samples/client/petstore/rust/reqwest/test-duplicates/git_push.sh b/samples/client/petstore/rust/reqwest/test-duplicates/git_push.sh new file mode 100644 index 000000000000..f53a75d4fabe --- /dev/null +++ b/samples/client/petstore/rust/reqwest/test-duplicates/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/rust/reqwest/test-duplicates/src/apis/configuration.rs b/samples/client/petstore/rust/reqwest/test-duplicates/src/apis/configuration.rs new file mode 100644 index 000000000000..5586a0a69201 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/test-duplicates/src/apis/configuration.rs @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * + * To test duplicates + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + +#[derive(Debug, Clone)] +pub struct Configuration { + pub base_path: String, + pub user_agent: Option, + pub client: reqwest::blocking::Client, + pub basic_auth: Option, + pub oauth_access_token: Option, + pub bearer_access_token: Option, + pub api_key: Option, +} + +pub type BasicAuth = (String, Option); + +#[derive(Debug, Clone)] +pub struct ApiKey { + pub prefix: Option, + pub key: String, +} + + +impl Configuration { + pub fn new() -> Configuration { + Configuration::default() + } +} + +impl Default for Configuration { + fn default() -> Self { + Configuration { + base_path: "http://petstore.swagger.io/v2".to_owned(), + user_agent: Some("OpenAPI-Generator/1.0.0/rust".to_owned()), + client: reqwest::blocking::Client::new(), + basic_auth: None, + oauth_access_token: None, + bearer_access_token: None, + api_key: None, + } + } +} diff --git a/samples/client/petstore/rust/reqwest/test-duplicates/src/apis/mod.rs b/samples/client/petstore/rust/reqwest/test-duplicates/src/apis/mod.rs new file mode 100644 index 000000000000..e0babcb050e5 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/test-duplicates/src/apis/mod.rs @@ -0,0 +1,116 @@ +use std::error; +use std::fmt; + +#[derive(Debug, Clone)] +pub struct ResponseContent { + pub status: reqwest::StatusCode, + pub content: String, + pub entity: Option, +} + +#[derive(Debug)] +pub enum Error { + Reqwest(reqwest::Error), + Serde(serde_json::Error), + Io(std::io::Error), + ResponseError(ResponseContent), +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let (module, e) = match self { + Error::Reqwest(e) => ("reqwest", e.to_string()), + Error::Serde(e) => ("serde", e.to_string()), + Error::Io(e) => ("IO", e.to_string()), + Error::ResponseError(e) => ("response", format!("status code {}", e.status)), + }; + write!(f, "error in {}: {}", module, e) + } +} + +impl error::Error for Error { + fn source(&self) -> Option<&(dyn error::Error + 'static)> { + Some(match self { + Error::Reqwest(e) => e, + Error::Serde(e) => e, + Error::Io(e) => e, + Error::ResponseError(_) => return None, + }) + } +} + +impl From for Error { + fn from(e: reqwest::Error) -> Self { + Error::Reqwest(e) + } +} + +impl From for Error { + fn from(e: serde_json::Error) -> Self { + Error::Serde(e) + } +} + +impl From for Error { + fn from(e: std::io::Error) -> Self { + Error::Io(e) + } +} + +pub fn urlencode>(s: T) -> String { + ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() +} + +pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { + if let serde_json::Value::Object(object) = value { + let mut params = vec![]; + + for (key, value) in object { + match value { + serde_json::Value::Object(_) => params.append(&mut parse_deep_object( + &format!("{}[{}]", prefix, key), + value, + )), + serde_json::Value::Array(array) => { + for (i, value) in array.iter().enumerate() { + params.append(&mut parse_deep_object( + &format!("{}[{}][{}]", prefix, key, i), + value, + )); + } + }, + serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), + _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), + } + } + + return params; + } + + unimplemented!("Only objects are supported with style=deepObject") +} + +/// Internal use only +/// A content type supported by this client. +#[allow(dead_code)] +enum ContentType { + Json, + Text, + Unsupported(String) +} + +impl From<&str> for ContentType { + fn from(content_type: &str) -> Self { + if content_type.starts_with("application") && content_type.contains("json") { + return Self::Json; + } else if content_type.starts_with("text/plain") { + return Self::Text; + } else { + return Self::Unsupported(content_type.to_string()); + } + } +} + +pub mod testing_api; + +pub mod configuration; diff --git a/samples/client/petstore/rust/reqwest/test-duplicates/src/apis/testing_api.rs b/samples/client/petstore/rust/reqwest/test-duplicates/src/apis/testing_api.rs new file mode 100644 index 000000000000..2304b4bc41dd --- /dev/null +++ b/samples/client/petstore/rust/reqwest/test-duplicates/src/apis/testing_api.rs @@ -0,0 +1,59 @@ +/* + * OpenAPI Petstore + * + * To test duplicates + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + + +/// struct for typed errors of method [`tests_discriminator_duplicate_enums_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TestsDiscriminatorDuplicateEnumsGetError { + UnknownValue(serde_json::Value), +} + + +pub fn tests_discriminator_duplicate_enums_get(configuration: &configuration::Configuration, ) -> Result> { + + let uri_str = format!("{}/tests/discriminatorDuplicateEnums", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req)?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text()?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TestsDiscriminatorDuplicateEnumsGet200Response`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TestsDiscriminatorDuplicateEnumsGet200Response`")))), + } + } else { + let content = resp.text()?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + diff --git a/samples/client/petstore/rust/reqwest/test-duplicates/src/lib.rs b/samples/client/petstore/rust/reqwest/test-duplicates/src/lib.rs new file mode 100644 index 000000000000..e1520628d762 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/test-duplicates/src/lib.rs @@ -0,0 +1,11 @@ +#![allow(unused_imports)] +#![allow(clippy::too_many_arguments)] + +extern crate serde_repr; +extern crate serde; +extern crate serde_json; +extern crate url; +extern crate reqwest; + +pub mod apis; +pub mod models; diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/_tests_discriminator_duplicate_enums_get_200_response.rs b/samples/client/petstore/rust/reqwest/test-duplicates/src/models/_tests_discriminator_duplicate_enums_get_200_response.rs similarity index 90% rename from samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/_tests_discriminator_duplicate_enums_get_200_response.rs rename to samples/client/petstore/rust/reqwest/test-duplicates/src/models/_tests_discriminator_duplicate_enums_get_200_response.rs index 5f7776745949..91ae6492101b 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/_tests_discriminator_duplicate_enums_get_200_response.rs +++ b/samples/client/petstore/rust/reqwest/test-duplicates/src/models/_tests_discriminator_duplicate_enums_get_200_response.rs @@ -1,7 +1,7 @@ /* * 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. + * To test duplicates * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/client/petstore/rust/reqwest-trait/petstore/src/models/duplicate_test.rs b/samples/client/petstore/rust/reqwest/test-duplicates/src/models/duplicate_test.rs similarity index 79% rename from samples/client/petstore/rust/reqwest-trait/petstore/src/models/duplicate_test.rs rename to samples/client/petstore/rust/reqwest/test-duplicates/src/models/duplicate_test.rs index a27e36772fc6..c9903c458bfc 100644 --- a/samples/client/petstore/rust/reqwest-trait/petstore/src/models/duplicate_test.rs +++ b/samples/client/petstore/rust/reqwest/test-duplicates/src/models/duplicate_test.rs @@ -1,7 +1,7 @@ /* * 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. + * To test duplicates * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/client/petstore/rust/hyper0x/petstore/src/models/duplicatetest.rs b/samples/client/petstore/rust/reqwest/test-duplicates/src/models/duplicatetest.rs similarity index 62% rename from samples/client/petstore/rust/hyper0x/petstore/src/models/duplicatetest.rs rename to samples/client/petstore/rust/reqwest/test-duplicates/src/models/duplicatetest.rs index f50f7b84ecbe..91447e4e4380 100644 --- a/samples/client/petstore/rust/hyper0x/petstore/src/models/duplicatetest.rs +++ b/samples/client/petstore/rust/reqwest/test-duplicates/src/models/duplicatetest.rs @@ -1,7 +1,7 @@ /* * 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. + * To test duplicates * * The version of the OpenAPI document: 1.0.0 * @@ -12,14 +12,14 @@ use crate::models; use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Duplicatetest { +pub struct another_test { #[serde(rename = "name", skip_serializing_if = "Option::is_none")] pub name: Option, } -impl Duplicatetest { - pub fn new() -> Duplicatetest { - Duplicatetest { +impl another_test { + pub fn new() -> another_test { + another_test { name: None, } } diff --git a/samples/client/petstore/rust/reqwest/test-duplicates/src/models/mod.rs b/samples/client/petstore/rust/reqwest/test-duplicates/src/models/mod.rs new file mode 100644 index 000000000000..6970bef34a08 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/test-duplicates/src/models/mod.rs @@ -0,0 +1,10 @@ +pub mod duplicate_test; +pub use self::duplicate_test::DuplicateTest; +pub mod person; +pub use self::person::Person; +pub mod _tests_discriminator_duplicate_enums_get_200_response; +pub use self::_tests_discriminator_duplicate_enums_get_200_response::TestsDiscriminatorDuplicateEnumsGet200Response; +pub mod vehicle; +pub use self::vehicle::Vehicle; +pub mod duplicatetest; +pub use self::duplicatetest::another_test; diff --git a/samples/client/petstore/rust/reqwest/test-duplicates/src/models/person.rs b/samples/client/petstore/rust/reqwest/test-duplicates/src/models/person.rs new file mode 100644 index 000000000000..2e922d0e7e64 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/test-duplicates/src/models/person.rs @@ -0,0 +1,30 @@ +/* + * OpenAPI Petstore + * + * To test duplicates + * + * 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 Person { + #[serde(rename = "type")] + pub r#type: String, + #[serde(rename = "name")] + pub name: String, +} + +impl Person { + pub fn new(r#type: String, name: String) -> Person { + Person { + r#type, + name, + } + } +} + diff --git a/samples/client/petstore/rust/reqwest/test-duplicates/src/models/vehicle.rs b/samples/client/petstore/rust/reqwest/test-duplicates/src/models/vehicle.rs new file mode 100644 index 000000000000..bbc5f65cf30e --- /dev/null +++ b/samples/client/petstore/rust/reqwest/test-duplicates/src/models/vehicle.rs @@ -0,0 +1,30 @@ +/* + * OpenAPI Petstore + * + * To test duplicates + * + * 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 Vehicle { + #[serde(rename = "type")] + pub r#type: String, + #[serde(rename = "speed")] + pub speed: f64, +} + +impl Vehicle { + pub fn new(r#type: String, speed: f64) -> Vehicle { + Vehicle { + r#type, + speed, + } + } +} +