Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions bin/configs/rust-hyper-test-duplicates.yaml
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions bin/configs/rust-reqwest-test-duplicates.yaml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
4 changes: 0 additions & 4 deletions samples/client/petstore/rust/hyper/petstore/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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)
Expand Down
60 changes: 0 additions & 60 deletions samples/client/petstore/rust/hyper/petstore/docs/DefaultApi.md

This file was deleted.

11 changes: 0 additions & 11 deletions samples/client/petstore/rust/hyper/petstore/docs/DuplicateOneOf.md

This file was deleted.

This file was deleted.

This file was deleted.

26 changes: 0 additions & 26 deletions samples/client/petstore/rust/hyper/petstore/docs/TestingApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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()
Expand Down

This file was deleted.

Loading
Loading