[M][REQ][JAVA]: Add option to generate arrays with "uniqueItems" true as Sets rather than Lists (#5466)

* [REQ][JAVA]: Add option to generate arrays with "uniqueItems" true as Sets rather than Lists
 - Update Java code generation to use sets instead of lists when uniqueItems is set to true
 - Add import resolution for sets
 - Add tests and fix broke tests

resolve #5254

* Update Javascript, Perl, Python and Ruby to preserve current functionality.

* Switch set implementation to LinkedHashSet

* Fix missing import for uniqueItems used on param.

* Fix missing import and return type for responses with uniqueItems

* Fix default values for array of enum

* Update generated samples

* fix merge issue

* Update generated samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
This commit is contained in:
Januson
2020-05-21 07:27:57 +02:00
committed by GitHub
parent dec1365619
commit c49d8fda8e
348 changed files with 1264 additions and 604 deletions

View File

@@ -9,7 +9,7 @@ Name | Type | Description | Notes
**id** | **Long** | | [optional]
**category** | [**Category**](Category.md) | | [optional]
**name** | **String** | |
**photoUrls** | **List&lt;String&gt;** | |
**photoUrls** | **Set&lt;String&gt;** | |
**tags** | [**List&lt;Tag&gt;**](Tag.md) | | [optional]
**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional]

View File

@@ -227,7 +227,7 @@ Name | Type | Description | Notes
## findPetsByTags
> List&lt;Pet&gt; findPetsByTags(tags)
> Set&lt;Pet&gt; findPetsByTags(tags)
Finds Pets by tags
@@ -254,9 +254,9 @@ public class Example {
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
PetApi apiInstance = new PetApi(defaultClient);
List<String> tags = Arrays.asList(); // List<String> | Tags to filter by
Set<String> tags = Arrays.asList(); // Set<String> | Tags to filter by
try {
List<Pet> result = apiInstance.findPetsByTags(tags);
Set<Pet> result = apiInstance.findPetsByTags(tags);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PetApi#findPetsByTags");
@@ -274,11 +274,11 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**tags** | [**List&lt;String&gt;**](String.md)| Tags to filter by |
**tags** | [**Set&lt;String&gt;**](String.md)| Tags to filter by |
### Return type
[**List&lt;Pet&gt;**](Pet.md)
[**Set&lt;Pet&gt;**](Pet.md)
### Authorization