diff --git a/bin/java-petstore-all.sh b/bin/java-petstore-all.sh
index b108cc06a4d..d3e98a74894 100755
--- a/bin/java-petstore-all.sh
+++ b/bin/java-petstore-all.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# update java petstore for all supported http libraries
-./bin/java-petstore.sh
+./bin/java-petstore-jersey1.sh
./bin/java-petstore-jersey2.sh
./bin/java-petstore-feign.sh
./bin/java-petstore-okhttp-gson.sh
diff --git a/bin/java8-petstore-jersey2.sh b/bin/java8-petstore-jersey2.sh
old mode 100644
new mode 100755
diff --git a/samples/client/petstore/java/feign/.travis.yml b/samples/client/petstore/java/feign/.travis.yml
new file mode 100644
index 00000000000..33e79472abd
--- /dev/null
+++ b/samples/client/petstore/java/feign/.travis.yml
@@ -0,0 +1,29 @@
+#
+# Generated by: https://github.com/swagger-api/swagger-codegen.git
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+language: java
+jdk:
+ - oraclejdk8
+ - oraclejdk7
+before_install:
+ # ensure gradlew has proper permission
+ - chmod a+x ./gradlew
+script:
+ # test using maven
+ - mvn test
+ # uncomment below to test using gradle
+ # - gradle test
+ # uncomment below to test using sbt
+ # - sbt test
diff --git a/samples/client/petstore/java/feign/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java/feign/docs/AdditionalPropertiesClass.md
new file mode 100644
index 00000000000..0437c4dd8cc
--- /dev/null
+++ b/samples/client/petstore/java/feign/docs/AdditionalPropertiesClass.md
@@ -0,0 +1,11 @@
+
+# AdditionalPropertiesClass
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**mapProperty** | **Map<String, String>** | | [optional]
+**mapOfMapProperty** | [**Map<String, Map<String, String>>**](Map.md) | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/feign/docs/Animal.md b/samples/client/petstore/java/feign/docs/Animal.md
new file mode 100644
index 00000000000..b3f325c3524
--- /dev/null
+++ b/samples/client/petstore/java/feign/docs/Animal.md
@@ -0,0 +1,11 @@
+
+# Animal
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**className** | **String** | |
+**color** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/feign/docs/AnimalFarm.md b/samples/client/petstore/java/feign/docs/AnimalFarm.md
new file mode 100644
index 00000000000..c7c7f1ddcce
--- /dev/null
+++ b/samples/client/petstore/java/feign/docs/AnimalFarm.md
@@ -0,0 +1,9 @@
+
+# AnimalFarm
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+
+
diff --git a/samples/client/petstore/java/feign/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java/feign/docs/ArrayOfArrayOfNumberOnly.md
new file mode 100644
index 00000000000..77292549927
--- /dev/null
+++ b/samples/client/petstore/java/feign/docs/ArrayOfArrayOfNumberOnly.md
@@ -0,0 +1,10 @@
+
+# ArrayOfArrayOfNumberOnly
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**arrayArrayNumber** | [**List<List<BigDecimal>>**](List.md) | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/feign/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java/feign/docs/ArrayOfNumberOnly.md
new file mode 100644
index 00000000000..e8cc4cd36dc
--- /dev/null
+++ b/samples/client/petstore/java/feign/docs/ArrayOfNumberOnly.md
@@ -0,0 +1,10 @@
+
+# ArrayOfNumberOnly
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**arrayNumber** | [**List<BigDecimal>**](BigDecimal.md) | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/feign/docs/ArrayTest.md b/samples/client/petstore/java/feign/docs/ArrayTest.md
new file mode 100644
index 00000000000..9feee16427f
--- /dev/null
+++ b/samples/client/petstore/java/feign/docs/ArrayTest.md
@@ -0,0 +1,12 @@
+
+# ArrayTest
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**arrayOfString** | **List<String>** | | [optional]
+**arrayArrayOfInteger** | [**List<List<Long>>**](List.md) | | [optional]
+**arrayArrayOfModel** | [**List<List<ReadOnlyFirst>>**](List.md) | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/feign/docs/Cat.md b/samples/client/petstore/java/feign/docs/Cat.md
new file mode 100644
index 00000000000..be6e56fa8ce
--- /dev/null
+++ b/samples/client/petstore/java/feign/docs/Cat.md
@@ -0,0 +1,12 @@
+
+# Cat
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**className** | **String** | |
+**color** | **String** | | [optional]
+**declawed** | **Boolean** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/feign/docs/Category.md b/samples/client/petstore/java/feign/docs/Category.md
new file mode 100644
index 00000000000..e2df0803278
--- /dev/null
+++ b/samples/client/petstore/java/feign/docs/Category.md
@@ -0,0 +1,11 @@
+
+# Category
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Long** | | [optional]
+**name** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/feign/docs/Dog.md b/samples/client/petstore/java/feign/docs/Dog.md
new file mode 100644
index 00000000000..71a7dbe809e
--- /dev/null
+++ b/samples/client/petstore/java/feign/docs/Dog.md
@@ -0,0 +1,12 @@
+
+# Dog
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**className** | **String** | |
+**color** | **String** | | [optional]
+**breed** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/feign/docs/EnumClass.md b/samples/client/petstore/java/feign/docs/EnumClass.md
new file mode 100644
index 00000000000..c746edc3cb1
--- /dev/null
+++ b/samples/client/petstore/java/feign/docs/EnumClass.md
@@ -0,0 +1,14 @@
+
+# EnumClass
+
+## Enum
+
+
+* `_ABC` (value: `"_abc"`)
+
+* `_EFG` (value: `"-efg"`)
+
+* `_XYZ_` (value: `"(xyz)"`)
+
+
+
diff --git a/samples/client/petstore/java/feign/docs/EnumTest.md b/samples/client/petstore/java/feign/docs/EnumTest.md
new file mode 100644
index 00000000000..deb1951c552
--- /dev/null
+++ b/samples/client/petstore/java/feign/docs/EnumTest.md
@@ -0,0 +1,36 @@
+
+# EnumTest
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional]
+**enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional]
+**enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional]
+
+
+
+## Enum: EnumStringEnum
+Name | Value
+---- | -----
+UPPER | "UPPER"
+LOWER | "lower"
+
+
+
+## Enum: EnumIntegerEnum
+Name | Value
+---- | -----
+NUMBER_1 | 1
+NUMBER_MINUS_1 | -1
+
+
+
+## Enum: EnumNumberEnum
+Name | Value
+---- | -----
+NUMBER_1_DOT_1 | 1.1
+NUMBER_MINUS_1_DOT_2 | -1.2
+
+
+
diff --git a/samples/client/petstore/java/feign/docs/FakeApi.md b/samples/client/petstore/java/feign/docs/FakeApi.md
new file mode 100644
index 00000000000..21a4db7c377
--- /dev/null
+++ b/samples/client/petstore/java/feign/docs/FakeApi.md
@@ -0,0 +1,122 @@
+# FakeApi
+
+All URIs are relative to *http://petstore.swagger.io/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+[**testEnumQueryParameters**](FakeApi.md#testEnumQueryParameters) | **GET** /fake | To test enum query parameters
+
+
+
+# **testEndpointParameters**
+> testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password)
+
+Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+
+Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+
+### Example
+```java
+// Import classes:
+//import io.swagger.client.ApiException;
+//import io.swagger.client.api.FakeApi;
+
+
+FakeApi apiInstance = new FakeApi();
+BigDecimal number = new BigDecimal(); // BigDecimal | None
+Double _double = 3.4D; // Double | None
+String string = "string_example"; // String | None
+byte[] _byte = B; // byte[] | None
+Integer integer = 56; // Integer | None
+Integer int32 = 56; // Integer | None
+Long int64 = 789L; // Long | None
+Float _float = 3.4F; // Float | None
+byte[] binary = B; // byte[] | None
+LocalDate date = new LocalDate(); // LocalDate | None
+DateTime dateTime = new DateTime(); // DateTime | None
+String password = "password_example"; // String | None
+try {
+ apiInstance.testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password);
+} catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#testEndpointParameters");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **number** | **BigDecimal**| None |
+ **_double** | **Double**| None |
+ **string** | **String**| None |
+ **_byte** | **byte[]**| None |
+ **integer** | **Integer**| None | [optional]
+ **int32** | **Integer**| None | [optional]
+ **int64** | **Long**| None | [optional]
+ **_float** | **Float**| None | [optional]
+ **binary** | **byte[]**| None | [optional]
+ **date** | **LocalDate**| None | [optional]
+ **dateTime** | **DateTime**| None | [optional]
+ **password** | **String**| None | [optional]
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8
+ - **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8
+
+
+# **testEnumQueryParameters**
+> testEnumQueryParameters(enumQueryString, enumQueryInteger, enumQueryDouble)
+
+To test enum query parameters
+
+### Example
+```java
+// Import classes:
+//import io.swagger.client.ApiException;
+//import io.swagger.client.api.FakeApi;
+
+
+FakeApi apiInstance = new FakeApi();
+String enumQueryString = "-efg"; // String | Query parameter enum test (string)
+BigDecimal enumQueryInteger = new BigDecimal(); // BigDecimal | Query parameter enum test (double)
+Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double)
+try {
+ apiInstance.testEnumQueryParameters(enumQueryString, enumQueryInteger, enumQueryDouble);
+} catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#testEnumQueryParameters");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
+ **enumQueryInteger** | **BigDecimal**| Query parameter enum test (double) | [optional]
+ **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional]
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
diff --git a/samples/client/petstore/java/feign/docs/FormatTest.md b/samples/client/petstore/java/feign/docs/FormatTest.md
new file mode 100644
index 00000000000..44de7d9511a
--- /dev/null
+++ b/samples/client/petstore/java/feign/docs/FormatTest.md
@@ -0,0 +1,22 @@
+
+# FormatTest
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**integer** | **Integer** | | [optional]
+**int32** | **Integer** | | [optional]
+**int64** | **Long** | | [optional]
+**number** | [**BigDecimal**](BigDecimal.md) | |
+**_float** | **Float** | | [optional]
+**_double** | **Double** | | [optional]
+**string** | **String** | | [optional]
+**_byte** | **byte[]** | |
+**binary** | **byte[]** | | [optional]
+**date** | [**LocalDate**](LocalDate.md) | |
+**dateTime** | [**DateTime**](DateTime.md) | | [optional]
+**uuid** | **String** | | [optional]
+**password** | **String** | |
+
+
+
diff --git a/samples/client/petstore/java/feign/docs/HasOnlyReadOnly.md b/samples/client/petstore/java/feign/docs/HasOnlyReadOnly.md
new file mode 100644
index 00000000000..c1d0aac5672
--- /dev/null
+++ b/samples/client/petstore/java/feign/docs/HasOnlyReadOnly.md
@@ -0,0 +1,11 @@
+
+# HasOnlyReadOnly
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**bar** | **String** | | [optional]
+**foo** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/feign/docs/MapTest.md b/samples/client/petstore/java/feign/docs/MapTest.md
new file mode 100644
index 00000000000..c671e97ffbc
--- /dev/null
+++ b/samples/client/petstore/java/feign/docs/MapTest.md
@@ -0,0 +1,17 @@
+
+# MapTest
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional]
+**mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional]
+
+
+
+## Enum: Map<String, InnerEnum>
+Name | Value
+---- | -----
+
+
+
diff --git a/samples/client/petstore/java/feign/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/feign/docs/MixedPropertiesAndAdditionalPropertiesClass.md
new file mode 100644
index 00000000000..e3487bcc501
--- /dev/null
+++ b/samples/client/petstore/java/feign/docs/MixedPropertiesAndAdditionalPropertiesClass.md
@@ -0,0 +1,12 @@
+
+# MixedPropertiesAndAdditionalPropertiesClass
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**uuid** | **String** | | [optional]
+**dateTime** | [**DateTime**](DateTime.md) | | [optional]
+**map** | [**Map<String, Animal>**](Animal.md) | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/feign/docs/Model200Response.md b/samples/client/petstore/java/feign/docs/Model200Response.md
new file mode 100644
index 00000000000..b47618b28cc
--- /dev/null
+++ b/samples/client/petstore/java/feign/docs/Model200Response.md
@@ -0,0 +1,11 @@
+
+# Model200Response
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **Integer** | | [optional]
+**PropertyClass** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/feign/docs/ModelApiResponse.md b/samples/client/petstore/java/feign/docs/ModelApiResponse.md
new file mode 100644
index 00000000000..3eec8686cc9
--- /dev/null
+++ b/samples/client/petstore/java/feign/docs/ModelApiResponse.md
@@ -0,0 +1,12 @@
+
+# ModelApiResponse
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**code** | **Integer** | | [optional]
+**type** | **String** | | [optional]
+**message** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/feign/docs/ModelReturn.md b/samples/client/petstore/java/feign/docs/ModelReturn.md
new file mode 100644
index 00000000000..a679b04953e
--- /dev/null
+++ b/samples/client/petstore/java/feign/docs/ModelReturn.md
@@ -0,0 +1,10 @@
+
+# ModelReturn
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**_return** | **Integer** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/feign/docs/Name.md b/samples/client/petstore/java/feign/docs/Name.md
new file mode 100644
index 00000000000..ce2fb4dee50
--- /dev/null
+++ b/samples/client/petstore/java/feign/docs/Name.md
@@ -0,0 +1,13 @@
+
+# Name
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **Integer** | |
+**snakeCase** | **Integer** | | [optional]
+**property** | **String** | | [optional]
+**_123Number** | **Integer** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/feign/docs/NumberOnly.md b/samples/client/petstore/java/feign/docs/NumberOnly.md
new file mode 100644
index 00000000000..a3feac7fadc
--- /dev/null
+++ b/samples/client/petstore/java/feign/docs/NumberOnly.md
@@ -0,0 +1,10 @@
+
+# NumberOnly
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**justNumber** | [**BigDecimal**](BigDecimal.md) | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/feign/docs/Order.md b/samples/client/petstore/java/feign/docs/Order.md
new file mode 100644
index 00000000000..a1089f5384e
--- /dev/null
+++ b/samples/client/petstore/java/feign/docs/Order.md
@@ -0,0 +1,24 @@
+
+# Order
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Long** | | [optional]
+**petId** | **Long** | | [optional]
+**quantity** | **Integer** | | [optional]
+**shipDate** | [**DateTime**](DateTime.md) | | [optional]
+**status** | [**StatusEnum**](#StatusEnum) | Order Status | [optional]
+**complete** | **Boolean** | | [optional]
+
+
+
+## Enum: StatusEnum
+Name | Value
+---- | -----
+PLACED | "placed"
+APPROVED | "approved"
+DELIVERED | "delivered"
+
+
+
diff --git a/samples/client/petstore/java/feign/docs/Pet.md b/samples/client/petstore/java/feign/docs/Pet.md
new file mode 100644
index 00000000000..5b63109ef92
--- /dev/null
+++ b/samples/client/petstore/java/feign/docs/Pet.md
@@ -0,0 +1,24 @@
+
+# Pet
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Long** | | [optional]
+**category** | [**Category**](Category.md) | | [optional]
+**name** | **String** | |
+**photoUrls** | **List<String>** | |
+**tags** | [**List<Tag>**](Tag.md) | | [optional]
+**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional]
+
+
+
+## Enum: StatusEnum
+Name | Value
+---- | -----
+AVAILABLE | "available"
+PENDING | "pending"
+SOLD | "sold"
+
+
+
diff --git a/samples/client/petstore/java/feign/docs/PetApi.md b/samples/client/petstore/java/feign/docs/PetApi.md
new file mode 100644
index 00000000000..e0314e20e51
--- /dev/null
+++ b/samples/client/petstore/java/feign/docs/PetApi.md
@@ -0,0 +1,448 @@
+# PetApi
+
+All URIs are relative to *http://petstore.swagger.io/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store
+[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet
+[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
+[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags
+[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID
+[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet
+[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
+[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
+
+
+
+# **addPet**
+> addPet(body)
+
+Add a new pet to the store
+
+
+
+### Example
+```java
+// Import classes:
+//import io.swagger.client.ApiClient;
+//import io.swagger.client.ApiException;
+//import io.swagger.client.Configuration;
+//import io.swagger.client.auth.*;
+//import io.swagger.client.api.PetApi;
+
+ApiClient defaultClient = Configuration.getDefaultApiClient();
+
+// Configure OAuth2 access token for authorization: petstore_auth
+OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+PetApi apiInstance = new PetApi();
+Pet body = new Pet(); // Pet | Pet object that needs to be added to the store
+try {
+ apiInstance.addPet(body);
+} catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#addPet");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json, application/xml
+ - **Accept**: application/xml, application/json
+
+
+# **deletePet**
+> deletePet(petId, apiKey)
+
+Deletes a pet
+
+
+
+### Example
+```java
+// Import classes:
+//import io.swagger.client.ApiClient;
+//import io.swagger.client.ApiException;
+//import io.swagger.client.Configuration;
+//import io.swagger.client.auth.*;
+//import io.swagger.client.api.PetApi;
+
+ApiClient defaultClient = Configuration.getDefaultApiClient();
+
+// Configure OAuth2 access token for authorization: petstore_auth
+OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+PetApi apiInstance = new PetApi();
+Long petId = 789L; // Long | Pet id to delete
+String apiKey = "apiKey_example"; // String |
+try {
+ apiInstance.deletePet(petId, apiKey);
+} catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#deletePet");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **petId** | **Long**| Pet id to delete |
+ **apiKey** | **String**| | [optional]
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+
+# **findPetsByStatus**
+> List<Pet> findPetsByStatus(status)
+
+Finds Pets by status
+
+Multiple status values can be provided with comma separated strings
+
+### Example
+```java
+// Import classes:
+//import io.swagger.client.ApiClient;
+//import io.swagger.client.ApiException;
+//import io.swagger.client.Configuration;
+//import io.swagger.client.auth.*;
+//import io.swagger.client.api.PetApi;
+
+ApiClient defaultClient = Configuration.getDefaultApiClient();
+
+// Configure OAuth2 access token for authorization: petstore_auth
+OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+PetApi apiInstance = new PetApi();
+List status = Arrays.asList("status_example"); // List | Status values that need to be considered for filter
+try {
+ List result = apiInstance.findPetsByStatus(status);
+ System.out.println(result);
+} catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#findPetsByStatus");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **status** | [**List<String>**](String.md)| Status values that need to be considered for filter |
+
+### Return type
+
+[**List<Pet>**](Pet.md)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+
+# **findPetsByTags**
+> List<Pet> findPetsByTags(tags)
+
+Finds Pets by tags
+
+Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+
+### Example
+```java
+// Import classes:
+//import io.swagger.client.ApiClient;
+//import io.swagger.client.ApiException;
+//import io.swagger.client.Configuration;
+//import io.swagger.client.auth.*;
+//import io.swagger.client.api.PetApi;
+
+ApiClient defaultClient = Configuration.getDefaultApiClient();
+
+// Configure OAuth2 access token for authorization: petstore_auth
+OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+PetApi apiInstance = new PetApi();
+List tags = Arrays.asList("tags_example"); // List | Tags to filter by
+try {
+ List result = apiInstance.findPetsByTags(tags);
+ System.out.println(result);
+} catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#findPetsByTags");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **tags** | [**List<String>**](String.md)| Tags to filter by |
+
+### Return type
+
+[**List<Pet>**](Pet.md)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+
+# **getPetById**
+> Pet getPetById(petId)
+
+Find pet by ID
+
+Returns a single pet
+
+### Example
+```java
+// Import classes:
+//import io.swagger.client.ApiClient;
+//import io.swagger.client.ApiException;
+//import io.swagger.client.Configuration;
+//import io.swagger.client.auth.*;
+//import io.swagger.client.api.PetApi;
+
+ApiClient defaultClient = Configuration.getDefaultApiClient();
+
+// Configure API key authorization: api_key
+ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
+api_key.setApiKey("YOUR API KEY");
+// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+//api_key.setApiKeyPrefix("Token");
+
+PetApi apiInstance = new PetApi();
+Long petId = 789L; // Long | ID of pet to return
+try {
+ Pet result = apiInstance.getPetById(petId);
+ System.out.println(result);
+} catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#getPetById");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **petId** | **Long**| ID of pet to return |
+
+### Return type
+
+[**Pet**](Pet.md)
+
+### Authorization
+
+[api_key](../README.md#api_key)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+
+# **updatePet**
+> updatePet(body)
+
+Update an existing pet
+
+
+
+### Example
+```java
+// Import classes:
+//import io.swagger.client.ApiClient;
+//import io.swagger.client.ApiException;
+//import io.swagger.client.Configuration;
+//import io.swagger.client.auth.*;
+//import io.swagger.client.api.PetApi;
+
+ApiClient defaultClient = Configuration.getDefaultApiClient();
+
+// Configure OAuth2 access token for authorization: petstore_auth
+OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+PetApi apiInstance = new PetApi();
+Pet body = new Pet(); // Pet | Pet object that needs to be added to the store
+try {
+ apiInstance.updatePet(body);
+} catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#updatePet");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json, application/xml
+ - **Accept**: application/xml, application/json
+
+
+# **updatePetWithForm**
+> updatePetWithForm(petId, name, status)
+
+Updates a pet in the store with form data
+
+
+
+### Example
+```java
+// Import classes:
+//import io.swagger.client.ApiClient;
+//import io.swagger.client.ApiException;
+//import io.swagger.client.Configuration;
+//import io.swagger.client.auth.*;
+//import io.swagger.client.api.PetApi;
+
+ApiClient defaultClient = Configuration.getDefaultApiClient();
+
+// Configure OAuth2 access token for authorization: petstore_auth
+OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+PetApi apiInstance = new PetApi();
+Long petId = 789L; // Long | ID of pet that needs to be updated
+String name = "name_example"; // String | Updated name of the pet
+String status = "status_example"; // String | Updated status of the pet
+try {
+ apiInstance.updatePetWithForm(petId, name, status);
+} catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#updatePetWithForm");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **petId** | **Long**| ID of pet that needs to be updated |
+ **name** | **String**| Updated name of the pet | [optional]
+ **status** | **String**| Updated status of the pet | [optional]
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: application/x-www-form-urlencoded
+ - **Accept**: application/xml, application/json
+
+
+# **uploadFile**
+> ModelApiResponse uploadFile(petId, additionalMetadata, file)
+
+uploads an image
+
+
+
+### Example
+```java
+// Import classes:
+//import io.swagger.client.ApiClient;
+//import io.swagger.client.ApiException;
+//import io.swagger.client.Configuration;
+//import io.swagger.client.auth.*;
+//import io.swagger.client.api.PetApi;
+
+ApiClient defaultClient = Configuration.getDefaultApiClient();
+
+// Configure OAuth2 access token for authorization: petstore_auth
+OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+PetApi apiInstance = new PetApi();
+Long petId = 789L; // Long | ID of pet to update
+String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server
+File file = new File("/path/to/file.txt"); // File | file to upload
+try {
+ ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file);
+ System.out.println(result);
+} catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#uploadFile");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **petId** | **Long**| ID of pet to update |
+ **additionalMetadata** | **String**| Additional data to pass to server | [optional]
+ **file** | **File**| file to upload | [optional]
+
+### Return type
+
+[**ModelApiResponse**](ModelApiResponse.md)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: multipart/form-data
+ - **Accept**: application/json
+
diff --git a/samples/client/petstore/java/feign/docs/ReadOnlyFirst.md b/samples/client/petstore/java/feign/docs/ReadOnlyFirst.md
new file mode 100644
index 00000000000..426b7cde95a
--- /dev/null
+++ b/samples/client/petstore/java/feign/docs/ReadOnlyFirst.md
@@ -0,0 +1,11 @@
+
+# ReadOnlyFirst
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**bar** | **String** | | [optional]
+**baz** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/feign/docs/SpecialModelName.md b/samples/client/petstore/java/feign/docs/SpecialModelName.md
new file mode 100644
index 00000000000..c2c6117c552
--- /dev/null
+++ b/samples/client/petstore/java/feign/docs/SpecialModelName.md
@@ -0,0 +1,10 @@
+
+# SpecialModelName
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**specialPropertyName** | **Long** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/feign/docs/StoreApi.md b/samples/client/petstore/java/feign/docs/StoreApi.md
new file mode 100644
index 00000000000..0b30791725a
--- /dev/null
+++ b/samples/client/petstore/java/feign/docs/StoreApi.md
@@ -0,0 +1,197 @@
+# StoreApi
+
+All URIs are relative to *http://petstore.swagger.io/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
+[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
+[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID
+[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet
+
+
+
+# **deleteOrder**
+> deleteOrder(orderId)
+
+Delete purchase order by ID
+
+For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
+
+### Example
+```java
+// Import classes:
+//import io.swagger.client.ApiException;
+//import io.swagger.client.api.StoreApi;
+
+
+StoreApi apiInstance = new StoreApi();
+String orderId = "orderId_example"; // String | ID of the order that needs to be deleted
+try {
+ apiInstance.deleteOrder(orderId);
+} catch (ApiException e) {
+ System.err.println("Exception when calling StoreApi#deleteOrder");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **orderId** | **String**| ID of the order that needs to be deleted |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+
+# **getInventory**
+> Map<String, Integer> getInventory()
+
+Returns pet inventories by status
+
+Returns a map of status codes to quantities
+
+### Example
+```java
+// Import classes:
+//import io.swagger.client.ApiClient;
+//import io.swagger.client.ApiException;
+//import io.swagger.client.Configuration;
+//import io.swagger.client.auth.*;
+//import io.swagger.client.api.StoreApi;
+
+ApiClient defaultClient = Configuration.getDefaultApiClient();
+
+// Configure API key authorization: api_key
+ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
+api_key.setApiKey("YOUR API KEY");
+// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+//api_key.setApiKeyPrefix("Token");
+
+StoreApi apiInstance = new StoreApi();
+try {
+ Map result = apiInstance.getInventory();
+ System.out.println(result);
+} catch (ApiException e) {
+ System.err.println("Exception when calling StoreApi#getInventory");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+[**Map<String, Integer>**](Map.md)
+
+### Authorization
+
+[api_key](../README.md#api_key)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+
+# **getOrderById**
+> Order getOrderById(orderId)
+
+Find purchase order by ID
+
+For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
+
+### Example
+```java
+// Import classes:
+//import io.swagger.client.ApiException;
+//import io.swagger.client.api.StoreApi;
+
+
+StoreApi apiInstance = new StoreApi();
+Long orderId = 789L; // Long | ID of pet that needs to be fetched
+try {
+ Order result = apiInstance.getOrderById(orderId);
+ System.out.println(result);
+} catch (ApiException e) {
+ System.err.println("Exception when calling StoreApi#getOrderById");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **orderId** | **Long**| ID of pet that needs to be fetched |
+
+### Return type
+
+[**Order**](Order.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+
+# **placeOrder**
+> Order placeOrder(body)
+
+Place an order for a pet
+
+
+
+### Example
+```java
+// Import classes:
+//import io.swagger.client.ApiException;
+//import io.swagger.client.api.StoreApi;
+
+
+StoreApi apiInstance = new StoreApi();
+Order body = new Order(); // Order | order placed for purchasing the pet
+try {
+ Order result = apiInstance.placeOrder(body);
+ System.out.println(result);
+} catch (ApiException e) {
+ System.err.println("Exception when calling StoreApi#placeOrder");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**Order**](Order.md)| order placed for purchasing the pet |
+
+### Return type
+
+[**Order**](Order.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
diff --git a/samples/client/petstore/java/feign/docs/Tag.md b/samples/client/petstore/java/feign/docs/Tag.md
new file mode 100644
index 00000000000..de6814b55d5
--- /dev/null
+++ b/samples/client/petstore/java/feign/docs/Tag.md
@@ -0,0 +1,11 @@
+
+# Tag
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Long** | | [optional]
+**name** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/feign/docs/User.md b/samples/client/petstore/java/feign/docs/User.md
new file mode 100644
index 00000000000..8b6753dd284
--- /dev/null
+++ b/samples/client/petstore/java/feign/docs/User.md
@@ -0,0 +1,17 @@
+
+# User
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Long** | | [optional]
+**username** | **String** | | [optional]
+**firstName** | **String** | | [optional]
+**lastName** | **String** | | [optional]
+**email** | **String** | | [optional]
+**password** | **String** | | [optional]
+**phone** | **String** | | [optional]
+**userStatus** | **Integer** | User Status | [optional]
+
+
+
diff --git a/samples/client/petstore/java/feign/docs/UserApi.md b/samples/client/petstore/java/feign/docs/UserApi.md
new file mode 100644
index 00000000000..8cdc15992ee
--- /dev/null
+++ b/samples/client/petstore/java/feign/docs/UserApi.md
@@ -0,0 +1,370 @@
+# UserApi
+
+All URIs are relative to *http://petstore.swagger.io/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**createUser**](UserApi.md#createUser) | **POST** /user | Create user
+[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array
+[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array
+[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user
+[**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name
+[**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system
+[**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session
+[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user
+
+
+
+# **createUser**
+> createUser(body)
+
+Create user
+
+This can only be done by the logged in user.
+
+### Example
+```java
+// Import classes:
+//import io.swagger.client.ApiException;
+//import io.swagger.client.api.UserApi;
+
+
+UserApi apiInstance = new UserApi();
+User body = new User(); // User | Created user object
+try {
+ apiInstance.createUser(body);
+} catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#createUser");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**User**](User.md)| Created user object |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+
+# **createUsersWithArrayInput**
+> createUsersWithArrayInput(body)
+
+Creates list of users with given input array
+
+
+
+### Example
+```java
+// Import classes:
+//import io.swagger.client.ApiException;
+//import io.swagger.client.api.UserApi;
+
+
+UserApi apiInstance = new UserApi();
+List body = Arrays.asList(new User()); // List | List of user object
+try {
+ apiInstance.createUsersWithArrayInput(body);
+} catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#createUsersWithArrayInput");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**List<User>**](User.md)| List of user object |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+
+# **createUsersWithListInput**
+> createUsersWithListInput(body)
+
+Creates list of users with given input array
+
+
+
+### Example
+```java
+// Import classes:
+//import io.swagger.client.ApiException;
+//import io.swagger.client.api.UserApi;
+
+
+UserApi apiInstance = new UserApi();
+List body = Arrays.asList(new User()); // List | List of user object
+try {
+ apiInstance.createUsersWithListInput(body);
+} catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#createUsersWithListInput");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**List<User>**](User.md)| List of user object |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+
+# **deleteUser**
+> deleteUser(username)
+
+Delete user
+
+This can only be done by the logged in user.
+
+### Example
+```java
+// Import classes:
+//import io.swagger.client.ApiException;
+//import io.swagger.client.api.UserApi;
+
+
+UserApi apiInstance = new UserApi();
+String username = "username_example"; // String | The name that needs to be deleted
+try {
+ apiInstance.deleteUser(username);
+} catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#deleteUser");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **String**| The name that needs to be deleted |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+
+# **getUserByName**
+> User getUserByName(username)
+
+Get user by user name
+
+
+
+### Example
+```java
+// Import classes:
+//import io.swagger.client.ApiException;
+//import io.swagger.client.api.UserApi;
+
+
+UserApi apiInstance = new UserApi();
+String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing.
+try {
+ User result = apiInstance.getUserByName(username);
+ System.out.println(result);
+} catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#getUserByName");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **String**| The name that needs to be fetched. Use user1 for testing. |
+
+### Return type
+
+[**User**](User.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+
+# **loginUser**
+> String loginUser(username, password)
+
+Logs user into the system
+
+
+
+### Example
+```java
+// Import classes:
+//import io.swagger.client.ApiException;
+//import io.swagger.client.api.UserApi;
+
+
+UserApi apiInstance = new UserApi();
+String username = "username_example"; // String | The user name for login
+String password = "password_example"; // String | The password for login in clear text
+try {
+ String result = apiInstance.loginUser(username, password);
+ System.out.println(result);
+} catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#loginUser");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **String**| The user name for login |
+ **password** | **String**| The password for login in clear text |
+
+### Return type
+
+**String**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+
+# **logoutUser**
+> logoutUser()
+
+Logs out current logged in user session
+
+
+
+### Example
+```java
+// Import classes:
+//import io.swagger.client.ApiException;
+//import io.swagger.client.api.UserApi;
+
+
+UserApi apiInstance = new UserApi();
+try {
+ apiInstance.logoutUser();
+} catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#logoutUser");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+
+# **updateUser**
+> updateUser(username, body)
+
+Updated user
+
+This can only be done by the logged in user.
+
+### Example
+```java
+// Import classes:
+//import io.swagger.client.ApiException;
+//import io.swagger.client.api.UserApi;
+
+
+UserApi apiInstance = new UserApi();
+String username = "username_example"; // String | name that need to be deleted
+User body = new User(); // User | Updated user object
+try {
+ apiInstance.updateUser(username, body);
+} catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#updateUser");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **String**| name that need to be deleted |
+ **body** | [**User**](User.md)| Updated user object |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
diff --git a/samples/client/petstore/java/feign/gradlew b/samples/client/petstore/java/feign/gradlew
old mode 100755
new mode 100644
diff --git a/samples/client/petstore/java/feign/hello.txt b/samples/client/petstore/java/feign/hello.txt
deleted file mode 100644
index 6769dd60bdf..00000000000
--- a/samples/client/petstore/java/feign/hello.txt
+++ /dev/null
@@ -1 +0,0 @@
-Hello world!
\ No newline at end of file
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/ApiCallback.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/ApiCallback.java
new file mode 100644
index 00000000000..3ca33cf8017
--- /dev/null
+++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/ApiCallback.java
@@ -0,0 +1,74 @@
+/**
+ * Swagger Petstore
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: apiteam@swagger.io
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package io.swagger.client;
+
+import java.io.IOException;
+
+import java.util.Map;
+import java.util.List;
+
+/**
+ * Callback for asynchronous API call.
+ *
+ * @param The return type
+ */
+public interface ApiCallback {
+ /**
+ * This is called when the API call fails.
+ *
+ * @param e The exception causing the failure
+ * @param statusCode Status code of the response if available, otherwise it would be 0
+ * @param responseHeaders Headers of the response if available, otherwise it would be null
+ */
+ void onFailure(ApiException e, int statusCode, Map> responseHeaders);
+
+ /**
+ * This is called when the API call succeeded.
+ *
+ * @param result The result deserialized from response
+ * @param statusCode Status code of the response
+ * @param responseHeaders Headers of the response
+ */
+ void onSuccess(T result, int statusCode, Map> responseHeaders);
+
+ /**
+ * This is called when the API upload processing.
+ *
+ * @param bytesWritten bytes Written
+ * @param contentLength content length of request body
+ * @param done write end
+ */
+ void onUploadProgress(long bytesWritten, long contentLength, boolean done);
+
+ /**
+ * This is called when the API downlond processing.
+ *
+ * @param bytesRead bytes Read
+ * @param contentLength content lenngth of the response
+ * @param done Read end
+ */
+ void onDownloadProgress(long bytesRead, long contentLength, boolean done);
+}
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/ApiClient.java
index 75b3a96f2c7..e21bded5212 100644
--- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/ApiClient.java
+++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/ApiClient.java
@@ -41,10 +41,10 @@ public class ApiClient {
this();
for(String authName : authNames) {
RequestInterceptor auth;
- if (authName == "petstore_auth") {
- auth = new OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets");
- } else if (authName == "api_key") {
+ if (authName == "api_key") {
auth = new ApiKeyAuth("header", "api_key");
+ } else if (authName == "petstore_auth") {
+ auth = new OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets");
} else {
throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names");
}
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/ApiException.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/ApiException.java
new file mode 100644
index 00000000000..3bed001f002
--- /dev/null
+++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/ApiException.java
@@ -0,0 +1,103 @@
+/**
+ * Swagger Petstore
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: apiteam@swagger.io
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package io.swagger.client;
+
+import java.util.Map;
+import java.util.List;
+
+
+public class ApiException extends Exception {
+ private int code = 0;
+ private Map> responseHeaders = null;
+ private String responseBody = null;
+
+ public ApiException() {}
+
+ public ApiException(Throwable throwable) {
+ super(throwable);
+ }
+
+ public ApiException(String message) {
+ super(message);
+ }
+
+ public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) {
+ super(message, throwable);
+ this.code = code;
+ this.responseHeaders = responseHeaders;
+ this.responseBody = responseBody;
+ }
+
+ public ApiException(String message, int code, Map> responseHeaders, String responseBody) {
+ this(message, (Throwable) null, code, responseHeaders, responseBody);
+ }
+
+ public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) {
+ this(message, throwable, code, responseHeaders, null);
+ }
+
+ public ApiException(int code, Map> responseHeaders, String responseBody) {
+ this((String) null, (Throwable) null, code, responseHeaders, responseBody);
+ }
+
+ public ApiException(int code, String message) {
+ super(message);
+ this.code = code;
+ }
+
+ public ApiException(int code, String message, Map> responseHeaders, String responseBody) {
+ this(code, message);
+ this.responseHeaders = responseHeaders;
+ this.responseBody = responseBody;
+ }
+
+ /**
+ * Get the HTTP status code.
+ *
+ * @return HTTP status code
+ */
+ public int getCode() {
+ return code;
+ }
+
+ /**
+ * Get the HTTP response headers.
+ *
+ * @return A map of list of string
+ */
+ public Map> getResponseHeaders() {
+ return responseHeaders;
+ }
+
+ /**
+ * Get the HTTP response body.
+ *
+ * @return Response body in the form of string
+ */
+ public String getResponseBody() {
+ return responseBody;
+ }
+}
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/ApiResponse.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/ApiResponse.java
new file mode 100644
index 00000000000..d7dde1ee939
--- /dev/null
+++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/ApiResponse.java
@@ -0,0 +1,71 @@
+/**
+ * Swagger Petstore
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: apiteam@swagger.io
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package io.swagger.client;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * API response returned by API call.
+ *
+ * @param T The type of data that is deserialized from response body
+ */
+public class ApiResponse {
+ final private int statusCode;
+ final private Map> headers;
+ final private T data;
+
+ /**
+ * @param statusCode The status code of HTTP response
+ * @param headers The headers of HTTP response
+ */
+ public ApiResponse(int statusCode, Map> headers) {
+ this(statusCode, headers, null);
+ }
+
+ /**
+ * @param statusCode The status code of HTTP response
+ * @param headers The headers of HTTP response
+ * @param data The object deserialized from response bod
+ */
+ public ApiResponse(int statusCode, Map> headers, T data) {
+ this.statusCode = statusCode;
+ this.headers = headers;
+ this.data = data;
+ }
+
+ public int getStatusCode() {
+ return statusCode;
+ }
+
+ public Map> getHeaders() {
+ return headers;
+ }
+
+ public T getData() {
+ return data;
+ }
+}
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/Configuration.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/Configuration.java
new file mode 100644
index 00000000000..5191b9b73c6
--- /dev/null
+++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/Configuration.java
@@ -0,0 +1,51 @@
+/**
+ * Swagger Petstore
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: apiteam@swagger.io
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package io.swagger.client;
+
+
+public class Configuration {
+ private static ApiClient defaultApiClient = new ApiClient();
+
+ /**
+ * Get the default API client, which would be used when creating API
+ * instances without providing an API client.
+ *
+ * @return Default API client
+ */
+ public static ApiClient getDefaultApiClient() {
+ return defaultApiClient;
+ }
+
+ /**
+ * Set the default API client, which would be used when creating API
+ * instances without providing an API client.
+ *
+ * @param apiClient API client
+ */
+ public static void setDefaultApiClient(ApiClient apiClient) {
+ defaultApiClient = apiClient;
+ }
+}
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/FormAwareEncoder.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/FormAwareEncoder.java
deleted file mode 100644
index 179a2834da9..00000000000
--- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/FormAwareEncoder.java
+++ /dev/null
@@ -1,197 +0,0 @@
-package io.swagger.client;
-
-import java.io.*;
-import java.lang.reflect.Type;
-import java.net.URLEncoder;
-import java.net.URLConnection;
-import java.nio.charset.Charset;
-import java.util.*;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-
-import feign.codec.EncodeException;
-import feign.codec.Encoder;
-import feign.RequestTemplate;
-
-
-public class FormAwareEncoder implements Encoder {
- public static final String UTF_8 = "utf-8";
- private static final String LINE_FEED = "\r\n";
- private static final String TWO_DASH = "--";
- private static final String BOUNDARY = "----------------314159265358979323846";
-
- private byte[] lineFeedBytes;
- private byte[] boundaryBytes;
- private byte[] twoDashBytes;
- private byte[] atBytes;
- private byte[] eqBytes;
-
- private final Encoder delegate;
- private final DateFormat dateFormat;
-
- public FormAwareEncoder(Encoder delegate) {
- this.delegate = delegate;
- // Use RFC3339 format for date and datetime.
- // See http://xml2rfc.ietf.org/public/rfc/html/rfc3339.html#anchor14
- this.dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
-
- // Use UTC as the default time zone.
- this.dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
- try {
- this.lineFeedBytes = LINE_FEED.getBytes(UTF_8);
- this.boundaryBytes = BOUNDARY.getBytes(UTF_8);
- this.twoDashBytes = TWO_DASH.getBytes(UTF_8);
- this.atBytes = "&".getBytes(UTF_8);
- this.eqBytes = "=".getBytes(UTF_8);
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- }
-
- public void encode(Object object, Type bodyType, RequestTemplate template) throws EncodeException {
- if (object instanceof Map) {
- try {
- encodeFormParams(template, (Map) object);
- } catch (IOException e) {
- throw new EncodeException("Failed to create request", e);
- }
- } else {
- delegate.encode(object, bodyType, template);
- }
- }
-
- private void encodeFormParams(RequestTemplate template, Map formParams) throws IOException {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
-
- boolean isMultiPart = isMultiPart(formParams);
- boolean isFirstField = true;
- for (Map.Entry param : formParams.entrySet()) {
- String keyStr = param.getKey();
- if (param.getValue() instanceof File) {
- addFilePart(baos, keyStr, (File) param.getValue());
- } else {
- String valueStr = parameterToString(param.getValue());
- if (isMultiPart) {
- addMultiPartFormField(baos, keyStr, valueStr);
- } else {
- addEncodedFormField(baos, keyStr, valueStr, isFirstField);
- isFirstField = false;
- }
- }
- }
-
- if (isMultiPart) {
- baos.write(lineFeedBytes);
- baos.write(twoDashBytes);
- baos.write(boundaryBytes);
- baos.write(twoDashBytes);
- baos.write(lineFeedBytes);
- }
-
- String contentType = isMultiPart ? "multipart/form-data; boundary=" + BOUNDARY : "application/x-www-form-urlencoded";
- template.header("Content-type");
- template.header("Content-type", contentType);
- template.header("MIME-Version", "1.0");
- template.body(baos.toByteArray(), Charset.forName(UTF_8));
- }
-
- /*
- * Currently only supports text files
- */
- private void addFilePart(ByteArrayOutputStream baos, String fieldName, File uploadFile) throws IOException {
- String fileName = uploadFile.getName();
- baos.write(twoDashBytes);
- baos.write(boundaryBytes);
- baos.write(lineFeedBytes);
-
- String contentDisposition = "Content-Disposition: form-data; name=\"" + fieldName
- + "\"; filename=\"" + fileName + "\"";
- baos.write(contentDisposition.getBytes(UTF_8));
- baos.write(lineFeedBytes);
- String contentType = "Content-Type: " + URLConnection.guessContentTypeFromName(fileName);
- baos.write(contentType.getBytes(UTF_8));
- baos.write(lineFeedBytes);
- baos.write(lineFeedBytes);
-
- BufferedReader reader = new BufferedReader(new FileReader(uploadFile));
- InputStream input = new FileInputStream(uploadFile);
- byte[] bytes = new byte[4096];
- int len = bytes.length;
- while ((len = input.read(bytes)) != -1) {
- baos.write(bytes, 0, len);
- baos.write(lineFeedBytes);
- }
-
- baos.write(lineFeedBytes);
- }
-
- private void addEncodedFormField(ByteArrayOutputStream baos, String name, String value, boolean isFirstField) throws IOException {
- if (!isFirstField) {
- baos.write(atBytes);
- }
-
- String encodedName = URLEncoder.encode(name, UTF_8);
- String encodedValue = URLEncoder.encode(value, UTF_8);
- baos.write(encodedName.getBytes(UTF_8));
- baos.write("=".getBytes(UTF_8));
- baos.write(encodedValue.getBytes(UTF_8));
- }
-
- private void addMultiPartFormField(ByteArrayOutputStream baos, String name, String value) throws IOException {
- baos.write(twoDashBytes);
- baos.write(boundaryBytes);
- baos.write(lineFeedBytes);
-
- String contentDisposition = "Content-Disposition: form-data; name=\"" + name + "\"";
- String contentType = "Content-Type: text/plain; charset=utf-8";
-
- baos.write(contentDisposition.getBytes(UTF_8));
- baos.write(lineFeedBytes);
- baos.write(contentType.getBytes(UTF_8));
- baos.write(lineFeedBytes);
- baos.write(lineFeedBytes);
- baos.write(value.getBytes(UTF_8));
- baos.write(lineFeedBytes);
- }
-
- private boolean isMultiPart(Map formParams) {
- boolean isMultiPart = false;
- for (Map.Entry entry : formParams.entrySet()) {
- if (entry.getValue() instanceof File) {
- isMultiPart = true;
- break;
- }
- }
- return isMultiPart;
- }
-
- /**
- * Format the given parameter object into string.
- */
- public String parameterToString(Object param) {
- if (param == null) {
- return "";
- } else if (param instanceof Date) {
- return formatDate((Date) param);
- } else if (param instanceof Collection) {
- StringBuilder b = new StringBuilder();
- for(Object o : (Collection)param) {
- if(b.length() > 0) {
- b.append(",");
- }
- b.append(String.valueOf(o));
- }
- return b.toString();
- } else {
- return String.valueOf(param);
- }
- }
-
- /**
- * Format the given Date object into string.
- */
- public String formatDate(Date date) {
- return dateFormat.format(date);
- }
-}
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/JSON.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/JSON.java
new file mode 100644
index 00000000000..540611eab9d
--- /dev/null
+++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/JSON.java
@@ -0,0 +1,237 @@
+/**
+ * Swagger Petstore
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: apiteam@swagger.io
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package io.swagger.client;
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.google.gson.JsonDeserializationContext;
+import com.google.gson.JsonDeserializer;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonNull;
+import com.google.gson.JsonParseException;
+import com.google.gson.JsonPrimitive;
+import com.google.gson.JsonSerializationContext;
+import com.google.gson.JsonSerializer;
+import com.google.gson.TypeAdapter;
+import com.google.gson.stream.JsonReader;
+import com.google.gson.stream.JsonWriter;
+
+import java.io.IOException;
+import java.io.StringReader;
+import java.lang.reflect.Type;
+import java.util.Date;
+
+import org.joda.time.DateTime;
+import org.joda.time.LocalDate;
+import org.joda.time.format.DateTimeFormatter;
+import org.joda.time.format.ISODateTimeFormat;
+
+public class JSON {
+ private ApiClient apiClient;
+ private Gson gson;
+
+ /**
+ * JSON constructor.
+ *
+ * @param apiClient An instance of ApiClient
+ */
+ public JSON(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ gson = new GsonBuilder()
+ .registerTypeAdapter(Date.class, new DateAdapter(apiClient))
+ .registerTypeAdapter(DateTime.class, new DateTimeTypeAdapter())
+ .registerTypeAdapter(LocalDate.class, new LocalDateTypeAdapter())
+ .create();
+ }
+
+ /**
+ * Get Gson.
+ *
+ * @return Gson
+ */
+ public Gson getGson() {
+ return gson;
+ }
+
+ /**
+ * Set Gson.
+ *
+ * @param gson Gson
+ */
+ public void setGson(Gson gson) {
+ this.gson = gson;
+ }
+
+ /**
+ * Serialize the given Java object into JSON string.
+ *
+ * @param obj Object
+ * @return String representation of the JSON
+ */
+ public String serialize(Object obj) {
+ return gson.toJson(obj);
+ }
+
+ /**
+ * Deserialize the given JSON string to Java object.
+ *
+ * @param Type
+ * @param body The JSON string
+ * @param returnType The type to deserialize inot
+ * @return The deserialized Java object
+ */
+ @SuppressWarnings("unchecked")
+ public T deserialize(String body, Type returnType) {
+ try {
+ if (apiClient.isLenientOnJson()) {
+ JsonReader jsonReader = new JsonReader(new StringReader(body));
+ // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean)
+ jsonReader.setLenient(true);
+ return gson.fromJson(jsonReader, returnType);
+ } else {
+ return gson.fromJson(body, returnType);
+ }
+ } catch (JsonParseException e) {
+ // Fallback processing when failed to parse JSON form response body:
+ // return the response body string directly for the String return type;
+ // parse response body into date or datetime for the Date return type.
+ if (returnType.equals(String.class))
+ return (T) body;
+ else if (returnType.equals(Date.class))
+ return (T) apiClient.parseDateOrDatetime(body);
+ else throw(e);
+ }
+ }
+}
+
+class DateAdapter implements JsonSerializer, JsonDeserializer {
+ private final ApiClient apiClient;
+
+ /**
+ * Constructor for DateAdapter
+ *
+ * @param apiClient Api client
+ */
+ public DateAdapter(ApiClient apiClient) {
+ super();
+ this.apiClient = apiClient;
+ }
+
+ /**
+ * Serialize
+ *
+ * @param src Date
+ * @param typeOfSrc Type
+ * @param context Json Serialization Context
+ * @return Json Element
+ */
+ @Override
+ public JsonElement serialize(Date src, Type typeOfSrc, JsonSerializationContext context) {
+ if (src == null) {
+ return JsonNull.INSTANCE;
+ } else {
+ return new JsonPrimitive(apiClient.formatDatetime(src));
+ }
+ }
+
+ /**
+ * Deserialize
+ *
+ * @param json Json element
+ * @param date Type
+ * @param typeOfSrc Type
+ * @param context Json Serialization Context
+ * @return Date
+ * @throw JsonParseException if fail to parse
+ */
+ @Override
+ public Date deserialize(JsonElement json, Type date, JsonDeserializationContext context) throws JsonParseException {
+ String str = json.getAsJsonPrimitive().getAsString();
+ try {
+ return apiClient.parseDateOrDatetime(str);
+ } catch (RuntimeException e) {
+ throw new JsonParseException(e);
+ }
+ }
+}
+
+/**
+ * Gson TypeAdapter for Joda DateTime type
+ */
+class DateTimeTypeAdapter extends TypeAdapter {
+
+ private final DateTimeFormatter formatter = ISODateTimeFormat.dateTime();
+
+ @Override
+ public void write(JsonWriter out, DateTime date) throws IOException {
+ if (date == null) {
+ out.nullValue();
+ } else {
+ out.value(formatter.print(date));
+ }
+ }
+
+ @Override
+ public DateTime read(JsonReader in) throws IOException {
+ switch (in.peek()) {
+ case NULL:
+ in.nextNull();
+ return null;
+ default:
+ String date = in.nextString();
+ return formatter.parseDateTime(date);
+ }
+ }
+}
+
+/**
+ * Gson TypeAdapter for Joda LocalDate type
+ */
+class LocalDateTypeAdapter extends TypeAdapter {
+
+ private final DateTimeFormatter formatter = ISODateTimeFormat.date();
+
+ @Override
+ public void write(JsonWriter out, LocalDate date) throws IOException {
+ if (date == null) {
+ out.nullValue();
+ } else {
+ out.value(formatter.print(date));
+ }
+ }
+
+ @Override
+ public LocalDate read(JsonReader in) throws IOException {
+ switch (in.peek()) {
+ case NULL:
+ in.nextNull();
+ return null;
+ default:
+ String date = in.nextString();
+ return formatter.parseLocalDate(date);
+ }
+ }
+}
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/Pair.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/Pair.java
new file mode 100644
index 00000000000..15b247eea93
--- /dev/null
+++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/Pair.java
@@ -0,0 +1,64 @@
+/**
+ * Swagger Petstore
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: apiteam@swagger.io
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package io.swagger.client;
+
+
+public class Pair {
+ private String name = "";
+ private String value = "";
+
+ public Pair (String name, String value) {
+ setName(name);
+ setValue(value);
+ }
+
+ private void setName(String name) {
+ if (!isValidString(name)) return;
+
+ this.name = name;
+ }
+
+ private void setValue(String value) {
+ if (!isValidString(value)) return;
+
+ this.value = value;
+ }
+
+ public String getName() {
+ return this.name;
+ }
+
+ public String getValue() {
+ return this.value;
+ }
+
+ private boolean isValidString(String arg) {
+ if (arg == null) return false;
+ if (arg.trim().isEmpty()) return false;
+
+ return true;
+ }
+}
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/ProgressRequestBody.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/ProgressRequestBody.java
new file mode 100644
index 00000000000..d9ca742ecd2
--- /dev/null
+++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/ProgressRequestBody.java
@@ -0,0 +1,95 @@
+/**
+ * Swagger Petstore
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: apiteam@swagger.io
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package io.swagger.client;
+
+import com.squareup.okhttp.MediaType;
+import com.squareup.okhttp.RequestBody;
+
+import java.io.IOException;
+
+import okio.Buffer;
+import okio.BufferedSink;
+import okio.ForwardingSink;
+import okio.Okio;
+import okio.Sink;
+
+public class ProgressRequestBody extends RequestBody {
+
+ public interface ProgressRequestListener {
+ void onRequestProgress(long bytesWritten, long contentLength, boolean done);
+ }
+
+ private final RequestBody requestBody;
+
+ private final ProgressRequestListener progressListener;
+
+ private BufferedSink bufferedSink;
+
+ public ProgressRequestBody(RequestBody requestBody, ProgressRequestListener progressListener) {
+ this.requestBody = requestBody;
+ this.progressListener = progressListener;
+ }
+
+ @Override
+ public MediaType contentType() {
+ return requestBody.contentType();
+ }
+
+ @Override
+ public long contentLength() throws IOException {
+ return requestBody.contentLength();
+ }
+
+ @Override
+ public void writeTo(BufferedSink sink) throws IOException {
+ if (bufferedSink == null) {
+ bufferedSink = Okio.buffer(sink(sink));
+ }
+
+ requestBody.writeTo(bufferedSink);
+ bufferedSink.flush();
+
+ }
+
+ private Sink sink(Sink sink) {
+ return new ForwardingSink(sink) {
+
+ long bytesWritten = 0L;
+ long contentLength = 0L;
+
+ @Override
+ public void write(Buffer source, long byteCount) throws IOException {
+ super.write(source, byteCount);
+ if (contentLength == 0) {
+ contentLength = contentLength();
+ }
+
+ bytesWritten += byteCount;
+ progressListener.onRequestProgress(bytesWritten, contentLength, bytesWritten == contentLength);
+ }
+ };
+ }
+}
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/ProgressResponseBody.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/ProgressResponseBody.java
new file mode 100644
index 00000000000..f8af685999d
--- /dev/null
+++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/ProgressResponseBody.java
@@ -0,0 +1,88 @@
+/**
+ * Swagger Petstore
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: apiteam@swagger.io
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package io.swagger.client;
+
+import com.squareup.okhttp.MediaType;
+import com.squareup.okhttp.ResponseBody;
+
+import java.io.IOException;
+
+import okio.Buffer;
+import okio.BufferedSource;
+import okio.ForwardingSource;
+import okio.Okio;
+import okio.Source;
+
+public class ProgressResponseBody extends ResponseBody {
+
+ public interface ProgressListener {
+ void update(long bytesRead, long contentLength, boolean done);
+ }
+
+ private final ResponseBody responseBody;
+ private final ProgressListener progressListener;
+ private BufferedSource bufferedSource;
+
+ public ProgressResponseBody(ResponseBody responseBody, ProgressListener progressListener) {
+ this.responseBody = responseBody;
+ this.progressListener = progressListener;
+ }
+
+ @Override
+ public MediaType contentType() {
+ return responseBody.contentType();
+ }
+
+ @Override
+ public long contentLength() throws IOException {
+ return responseBody.contentLength();
+ }
+
+ @Override
+ public BufferedSource source() throws IOException {
+ if (bufferedSource == null) {
+ bufferedSource = Okio.buffer(source(responseBody.source()));
+ }
+ return bufferedSource;
+ }
+
+ private Source source(Source source) {
+ return new ForwardingSource(source) {
+ long totalBytesRead = 0L;
+
+ @Override
+ public long read(Buffer sink, long byteCount) throws IOException {
+ long bytesRead = super.read(sink, byteCount);
+ // read() returns the number of bytes read, or -1 if this source is exhausted.
+ totalBytesRead += bytesRead != -1 ? bytesRead : 0;
+ progressListener.update(totalBytesRead, responseBody.contentLength(), bytesRead == -1);
+ return bytesRead;
+ }
+ };
+ }
+}
+
+
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/StringUtil.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/StringUtil.java
index 03c6c81e434..fdcef6b1010 100644
--- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/StringUtil.java
+++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/StringUtil.java
@@ -1,6 +1,6 @@
/**
* Swagger Petstore
- * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeApi.java
index dbabdc64995..fd559f5e624 100644
--- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeApi.java
+++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeApi.java
@@ -3,8 +3,8 @@ package io.swagger.client.api;
import io.swagger.client.ApiClient;
import org.joda.time.LocalDate;
-import java.math.BigDecimal;
import org.joda.time.DateTime;
+import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
@@ -39,4 +39,19 @@ public interface FakeApi extends ApiClient.Api {
"Accept: application/xml; charset=utf-8,application/json; charset=utf-8",
})
void testEndpointParameters(@Param("number") BigDecimal number, @Param("_double") Double _double, @Param("string") String string, @Param("_byte") byte[] _byte, @Param("integer") Integer integer, @Param("int32") Integer int32, @Param("int64") Long int64, @Param("_float") Float _float, @Param("binary") byte[] binary, @Param("date") LocalDate date, @Param("dateTime") DateTime dateTime, @Param("password") String password);
+
+ /**
+ * To test enum query parameters
+ *
+ * @param enumQueryString Query parameter enum test (string) (optional, default to -efg)
+ * @param enumQueryInteger Query parameter enum test (double) (optional)
+ * @param enumQueryDouble Query parameter enum test (double) (optional)
+ * @return void
+ */
+ @RequestLine("GET /fake?enum_query_integer={enumQueryInteger}")
+ @Headers({
+ "Content-type: application/json",
+ "Accept: application/json",
+ })
+ void testEnumQueryParameters(@Param("enumQueryString") String enumQueryString, @Param("enumQueryInteger") BigDecimal enumQueryInteger, @Param("enumQueryDouble") Double enumQueryDouble);
}
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/PetApi.java
index e486495c5a9..4d4cc14f625 100644
--- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/PetApi.java
+++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/PetApi.java
@@ -3,8 +3,8 @@ package io.swagger.client.api;
import io.swagger.client.ApiClient;
import io.swagger.client.model.Pet;
-import io.swagger.client.model.ModelApiResponse;
import java.io.File;
+import io.swagger.client.model.ModelApiResponse;
import java.util.ArrayList;
import java.util.HashMap;
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/auth/Authentication.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/auth/Authentication.java
new file mode 100644
index 00000000000..221a7d9dd1f
--- /dev/null
+++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/auth/Authentication.java
@@ -0,0 +1,41 @@
+/**
+ * Swagger Petstore
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: apiteam@swagger.io
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package io.swagger.client.auth;
+
+import io.swagger.client.Pair;
+
+import java.util.Map;
+import java.util.List;
+
+public interface Authentication {
+ /**
+ * Apply authentication settings to header and query params.
+ *
+ * @param queryParams List of query parameters
+ * @param headerParams Map of header parameters
+ */
+ void applyToParams(List queryParams, Map headerParams);
+}
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/auth/OAuthFlow.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/auth/OAuthFlow.java
index ec1f942b0f2..50d5260cfd9 100644
--- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/auth/OAuthFlow.java
+++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/auth/OAuthFlow.java
@@ -1,6 +1,6 @@
/**
* Swagger Petstore
- * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java
index ccaba7709c4..1943e013fa1 100644
--- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java
+++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java
@@ -1,8 +1,32 @@
+/**
+ * Swagger Petstore
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: apiteam@swagger.io
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
package io.swagger.client.model;
-import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.HashMap;
@@ -15,40 +39,44 @@ import java.util.Map;
*/
public class AdditionalPropertiesClass {
-
+ @SerializedName("map_property")
private Map mapProperty = new HashMap();
+
+ @SerializedName("map_of_map_property")
private Map> mapOfMapProperty = new HashMap>();
-
- /**
- **/
public AdditionalPropertiesClass mapProperty(Map mapProperty) {
this.mapProperty = mapProperty;
return this;
}
-
+
+ /**
+ * Get mapProperty
+ * @return mapProperty
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("map_property")
public Map getMapProperty() {
return mapProperty;
}
+
public void setMapProperty(Map mapProperty) {
this.mapProperty = mapProperty;
}
-
- /**
- **/
public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) {
this.mapOfMapProperty = mapOfMapProperty;
return this;
}
-
+
+ /**
+ * Get mapOfMapProperty
+ * @return mapOfMapProperty
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("map_of_map_property")
public Map> getMapOfMapProperty() {
return mapOfMapProperty;
}
+
public void setMapOfMapProperty(Map> mapOfMapProperty) {
this.mapOfMapProperty = mapOfMapProperty;
}
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Animal.java
index 25c7d3e421c..ba3806dc875 100644
--- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Animal.java
+++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Animal.java
@@ -1,8 +1,32 @@
+/**
+ * Swagger Petstore
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: apiteam@swagger.io
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
package io.swagger.client.model;
-import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -12,40 +36,44 @@ import io.swagger.annotations.ApiModelProperty;
*/
public class Animal {
-
+ @SerializedName("className")
private String className = null;
+
+ @SerializedName("color")
private String color = "red";
-
- /**
- **/
public Animal className(String className) {
this.className = className;
return this;
}
-
+
+ /**
+ * Get className
+ * @return className
+ **/
@ApiModelProperty(example = "null", required = true, value = "")
- @JsonProperty("className")
public String getClassName() {
return className;
}
+
public void setClassName(String className) {
this.className = className;
}
-
- /**
- **/
public Animal color(String color) {
this.color = color;
return this;
}
-
+
+ /**
+ * Get color
+ * @return color
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("color")
public String getColor() {
return color;
}
+
public void setColor(String color) {
this.color = color;
}
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AnimalFarm.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AnimalFarm.java
index 647e3a893e1..b54adb09d7b 100644
--- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AnimalFarm.java
+++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AnimalFarm.java
@@ -1,6 +1,30 @@
+/**
+ * Swagger Petstore
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: apiteam@swagger.io
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
package io.swagger.client.model;
-import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
import io.swagger.client.model.Animal;
import java.util.ArrayList;
@@ -12,9 +36,7 @@ import java.util.List;
*/
public class AnimalFarm extends ArrayList {
-
-
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java
new file mode 100644
index 00000000000..5446c2c439b
--- /dev/null
+++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java
@@ -0,0 +1,102 @@
+/**
+ * Swagger Petstore
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: apiteam@swagger.io
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package io.swagger.client.model;
+
+import java.util.Objects;
+import com.google.gson.annotations.SerializedName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * ArrayOfArrayOfNumberOnly
+ */
+
+public class ArrayOfArrayOfNumberOnly {
+ @SerializedName("ArrayArrayNumber")
+ private List> arrayArrayNumber = new ArrayList>();
+
+ public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) {
+ this.arrayArrayNumber = arrayArrayNumber;
+ return this;
+ }
+
+ /**
+ * Get arrayArrayNumber
+ * @return arrayArrayNumber
+ **/
+ @ApiModelProperty(example = "null", value = "")
+ public List> getArrayArrayNumber() {
+ return arrayArrayNumber;
+ }
+
+ public void setArrayArrayNumber(List> arrayArrayNumber) {
+ this.arrayArrayNumber = arrayArrayNumber;
+ }
+
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o;
+ return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(arrayArrayNumber);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class ArrayOfArrayOfNumberOnly {\n");
+
+ sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java
new file mode 100644
index 00000000000..c9257a5d3ee
--- /dev/null
+++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java
@@ -0,0 +1,102 @@
+/**
+ * Swagger Petstore
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: apiteam@swagger.io
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package io.swagger.client.model;
+
+import java.util.Objects;
+import com.google.gson.annotations.SerializedName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * ArrayOfNumberOnly
+ */
+
+public class ArrayOfNumberOnly {
+ @SerializedName("ArrayNumber")
+ private List arrayNumber = new ArrayList();
+
+ public ArrayOfNumberOnly arrayNumber(List arrayNumber) {
+ this.arrayNumber = arrayNumber;
+ return this;
+ }
+
+ /**
+ * Get arrayNumber
+ * @return arrayNumber
+ **/
+ @ApiModelProperty(example = "null", value = "")
+ public List getArrayNumber() {
+ return arrayNumber;
+ }
+
+ public void setArrayNumber(List arrayNumber) {
+ this.arrayNumber = arrayNumber;
+ }
+
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o;
+ return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(arrayNumber);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class ArrayOfNumberOnly {\n");
+
+ sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayTest.java
index 6c1eb23d8d0..8d58870bcdc 100644
--- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayTest.java
+++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayTest.java
@@ -1,10 +1,35 @@
+/**
+ * Swagger Petstore
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: apiteam@swagger.io
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
package io.swagger.client.model;
-import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
+import io.swagger.client.model.ReadOnlyFirst;
import java.util.ArrayList;
import java.util.List;
@@ -14,58 +39,65 @@ import java.util.List;
*/
public class ArrayTest {
-
+ @SerializedName("array_of_string")
private List arrayOfString = new ArrayList();
+
+ @SerializedName("array_array_of_integer")
private List> arrayArrayOfInteger = new ArrayList>();
+
+ @SerializedName("array_array_of_model")
private List> arrayArrayOfModel = new ArrayList>();
-
- /**
- **/
public ArrayTest arrayOfString(List arrayOfString) {
this.arrayOfString = arrayOfString;
return this;
}
-
+
+ /**
+ * Get arrayOfString
+ * @return arrayOfString
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("array_of_string")
public List getArrayOfString() {
return arrayOfString;
}
+
public void setArrayOfString(List arrayOfString) {
this.arrayOfString = arrayOfString;
}
-
- /**
- **/
public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) {
this.arrayArrayOfInteger = arrayArrayOfInteger;
return this;
}
-
+
+ /**
+ * Get arrayArrayOfInteger
+ * @return arrayArrayOfInteger
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("array_array_of_integer")
public List> getArrayArrayOfInteger() {
return arrayArrayOfInteger;
}
+
public void setArrayArrayOfInteger(List> arrayArrayOfInteger) {
this.arrayArrayOfInteger = arrayArrayOfInteger;
}
-
- /**
- **/
public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) {
this.arrayArrayOfModel = arrayArrayOfModel;
return this;
}
-
+
+ /**
+ * Get arrayArrayOfModel
+ * @return arrayArrayOfModel
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("array_array_of_model")
public List> getArrayArrayOfModel() {
return arrayArrayOfModel;
}
+
public void setArrayArrayOfModel(List> arrayArrayOfModel) {
this.arrayArrayOfModel = arrayArrayOfModel;
}
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Cat.java
index 5ef9e23bd96..21ed0f4c26b 100644
--- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Cat.java
+++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Cat.java
@@ -1,8 +1,32 @@
+/**
+ * Swagger Petstore
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: apiteam@swagger.io
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
package io.swagger.client.model;
-import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.client.model.Animal;
@@ -13,58 +37,65 @@ import io.swagger.client.model.Animal;
*/
public class Cat extends Animal {
-
+ @SerializedName("className")
private String className = null;
+
+ @SerializedName("color")
private String color = "red";
+
+ @SerializedName("declawed")
private Boolean declawed = null;
-
- /**
- **/
public Cat className(String className) {
this.className = className;
return this;
}
-
+
+ /**
+ * Get className
+ * @return className
+ **/
@ApiModelProperty(example = "null", required = true, value = "")
- @JsonProperty("className")
public String getClassName() {
return className;
}
+
public void setClassName(String className) {
this.className = className;
}
-
- /**
- **/
public Cat color(String color) {
this.color = color;
return this;
}
-
+
+ /**
+ * Get color
+ * @return color
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("color")
public String getColor() {
return color;
}
+
public void setColor(String color) {
this.color = color;
}
-
- /**
- **/
public Cat declawed(Boolean declawed) {
this.declawed = declawed;
return this;
}
-
+
+ /**
+ * Get declawed
+ * @return declawed
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("declawed")
public Boolean getDeclawed() {
return declawed;
}
+
public void setDeclawed(Boolean declawed) {
this.declawed = declawed;
}
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Category.java
index c6cb703a89e..2178a866f62 100644
--- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Category.java
+++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Category.java
@@ -1,8 +1,32 @@
+/**
+ * Swagger Petstore
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: apiteam@swagger.io
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
package io.swagger.client.model;
-import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -12,40 +36,44 @@ import io.swagger.annotations.ApiModelProperty;
*/
public class Category {
-
+ @SerializedName("id")
private Long id = null;
+
+ @SerializedName("name")
private String name = null;
-
- /**
- **/
public Category id(Long id) {
this.id = id;
return this;
}
-
+
+ /**
+ * Get id
+ * @return id
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("id")
public Long getId() {
return id;
}
+
public void setId(Long id) {
this.id = id;
}
-
- /**
- **/
public Category name(String name) {
this.name = name;
return this;
}
-
+
+ /**
+ * Get name
+ * @return name
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("name")
public String getName() {
return name;
}
+
public void setName(String name) {
this.name = name;
}
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Dog.java
index 4b3cc947cc5..4ba5804553f 100644
--- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Dog.java
+++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Dog.java
@@ -1,8 +1,32 @@
+/**
+ * Swagger Petstore
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: apiteam@swagger.io
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
package io.swagger.client.model;
-import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.client.model.Animal;
@@ -13,58 +37,65 @@ import io.swagger.client.model.Animal;
*/
public class Dog extends Animal {
-
+ @SerializedName("className")
private String className = null;
+
+ @SerializedName("color")
private String color = "red";
+
+ @SerializedName("breed")
private String breed = null;
-
- /**
- **/
public Dog className(String className) {
this.className = className;
return this;
}
-
+
+ /**
+ * Get className
+ * @return className
+ **/
@ApiModelProperty(example = "null", required = true, value = "")
- @JsonProperty("className")
public String getClassName() {
return className;
}
+
public void setClassName(String className) {
this.className = className;
}
-
- /**
- **/
public Dog color(String color) {
this.color = color;
return this;
}
-
+
+ /**
+ * Get color
+ * @return color
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("color")
public String getColor() {
return color;
}
+
public void setColor(String color) {
this.color = color;
}
-
- /**
- **/
public Dog breed(String breed) {
this.breed = breed;
return this;
}
-
+
+ /**
+ * Get breed
+ * @return breed
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("breed")
public String getBreed() {
return breed;
}
+
public void setBreed(String breed) {
this.breed = breed;
}
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumClass.java
index 42434e297ff..73484907229 100644
--- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumClass.java
+++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumClass.java
@@ -1,16 +1,46 @@
+/**
+ * Swagger Petstore
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: apiteam@swagger.io
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
package io.swagger.client.model;
-import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonValue;
+import com.google.gson.annotations.SerializedName;
/**
* Gets or Sets EnumClass
*/
public enum EnumClass {
+
+ @SerializedName("_abc")
_ABC("_abc"),
+
+ @SerializedName("-efg")
_EFG("-efg"),
+
+ @SerializedName("(xyz)")
_XYZ_("(xyz)");
private String value;
@@ -20,7 +50,6 @@ public enum EnumClass {
}
@Override
- @JsonValue
public String toString() {
return String.valueOf(value);
}
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumTest.java
index 1c8657fd3ec..9aad1223215 100644
--- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumTest.java
+++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumTest.java
@@ -1,9 +1,32 @@
+/**
+ * Swagger Petstore
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: apiteam@swagger.io
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
package io.swagger.client.model;
-import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonValue;
+import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -13,13 +36,14 @@ import io.swagger.annotations.ApiModelProperty;
*/
public class EnumTest {
-
-
/**
* Gets or Sets enumString
*/
public enum EnumStringEnum {
+ @SerializedName("UPPER")
UPPER("UPPER"),
+
+ @SerializedName("lower")
LOWER("lower");
private String value;
@@ -29,19 +53,22 @@ public class EnumTest {
}
@Override
- @JsonValue
public String toString() {
return String.valueOf(value);
}
}
+ @SerializedName("enum_string")
private EnumStringEnum enumString = null;
/**
* Gets or Sets enumInteger
*/
public enum EnumIntegerEnum {
+ @SerializedName("1")
NUMBER_1(1),
+
+ @SerializedName("-1")
NUMBER_MINUS_1(-1);
private Integer value;
@@ -51,19 +78,22 @@ public class EnumTest {
}
@Override
- @JsonValue
public String toString() {
return String.valueOf(value);
}
}
+ @SerializedName("enum_integer")
private EnumIntegerEnum enumInteger = null;
/**
* Gets or Sets enumNumber
*/
public enum EnumNumberEnum {
+ @SerializedName("1.1")
NUMBER_1_DOT_1(1.1),
+
+ @SerializedName("-1.2")
NUMBER_MINUS_1_DOT_2(-1.2);
private Double value;
@@ -73,61 +103,64 @@ public class EnumTest {
}
@Override
- @JsonValue
public String toString() {
return String.valueOf(value);
}
}
+ @SerializedName("enum_number")
private EnumNumberEnum enumNumber = null;
-
- /**
- **/
public EnumTest enumString(EnumStringEnum enumString) {
this.enumString = enumString;
return this;
}
-
+
+ /**
+ * Get enumString
+ * @return enumString
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("enum_string")
public EnumStringEnum getEnumString() {
return enumString;
}
+
public void setEnumString(EnumStringEnum enumString) {
this.enumString = enumString;
}
-
- /**
- **/
public EnumTest enumInteger(EnumIntegerEnum enumInteger) {
this.enumInteger = enumInteger;
return this;
}
-
+
+ /**
+ * Get enumInteger
+ * @return enumInteger
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("enum_integer")
public EnumIntegerEnum getEnumInteger() {
return enumInteger;
}
+
public void setEnumInteger(EnumIntegerEnum enumInteger) {
this.enumInteger = enumInteger;
}
-
- /**
- **/
public EnumTest enumNumber(EnumNumberEnum enumNumber) {
this.enumNumber = enumNumber;
return this;
}
-
+
+ /**
+ * Get enumNumber
+ * @return enumNumber
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("enum_number")
public EnumNumberEnum getEnumNumber() {
return enumNumber;
}
+
public void setEnumNumber(EnumNumberEnum enumNumber) {
this.enumNumber = enumNumber;
}
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/FormatTest.java
index 79376150017..91109681509 100644
--- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/FormatTest.java
+++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/FormatTest.java
@@ -1,8 +1,32 @@
+/**
+ * Swagger Petstore
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: apiteam@swagger.io
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
package io.swagger.client.model;
-import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
@@ -15,248 +39,285 @@ import org.joda.time.LocalDate;
*/
public class FormatTest {
-
+ @SerializedName("integer")
private Integer integer = null;
+
+ @SerializedName("int32")
private Integer int32 = null;
+
+ @SerializedName("int64")
private Long int64 = null;
+
+ @SerializedName("number")
private BigDecimal number = null;
+
+ @SerializedName("float")
private Float _float = null;
+
+ @SerializedName("double")
private Double _double = null;
+
+ @SerializedName("string")
private String string = null;
+
+ @SerializedName("byte")
private byte[] _byte = null;
+
+ @SerializedName("binary")
private byte[] binary = null;
+
+ @SerializedName("date")
private LocalDate date = null;
+
+ @SerializedName("dateTime")
private DateTime dateTime = null;
+
+ @SerializedName("uuid")
private String uuid = null;
+
+ @SerializedName("password")
private String password = null;
-
- /**
- * minimum: 10.0
- * maximum: 100.0
- **/
public FormatTest integer(Integer integer) {
this.integer = integer;
return this;
}
-
+
+ /**
+ * Get integer
+ * minimum: 10.0
+ * maximum: 100.0
+ * @return integer
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("integer")
public Integer getInteger() {
return integer;
}
+
public void setInteger(Integer integer) {
this.integer = integer;
}
-
- /**
- * minimum: 20.0
- * maximum: 200.0
- **/
public FormatTest int32(Integer int32) {
this.int32 = int32;
return this;
}
-
+
+ /**
+ * Get int32
+ * minimum: 20.0
+ * maximum: 200.0
+ * @return int32
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("int32")
public Integer getInt32() {
return int32;
}
+
public void setInt32(Integer int32) {
this.int32 = int32;
}
-
- /**
- **/
public FormatTest int64(Long int64) {
this.int64 = int64;
return this;
}
-
+
+ /**
+ * Get int64
+ * @return int64
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("int64")
public Long getInt64() {
return int64;
}
+
public void setInt64(Long int64) {
this.int64 = int64;
}
-
- /**
- * minimum: 32.1
- * maximum: 543.2
- **/
public FormatTest number(BigDecimal number) {
this.number = number;
return this;
}
-
+
+ /**
+ * Get number
+ * minimum: 32.1
+ * maximum: 543.2
+ * @return number
+ **/
@ApiModelProperty(example = "null", required = true, value = "")
- @JsonProperty("number")
public BigDecimal getNumber() {
return number;
}
+
public void setNumber(BigDecimal number) {
this.number = number;
}
-
- /**
- * minimum: 54.3
- * maximum: 987.6
- **/
public FormatTest _float(Float _float) {
this._float = _float;
return this;
}
-
+
+ /**
+ * Get _float
+ * minimum: 54.3
+ * maximum: 987.6
+ * @return _float
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("float")
public Float getFloat() {
return _float;
}
+
public void setFloat(Float _float) {
this._float = _float;
}
-
- /**
- * minimum: 67.8
- * maximum: 123.4
- **/
public FormatTest _double(Double _double) {
this._double = _double;
return this;
}
-
+
+ /**
+ * Get _double
+ * minimum: 67.8
+ * maximum: 123.4
+ * @return _double
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("double")
public Double getDouble() {
return _double;
}
+
public void setDouble(Double _double) {
this._double = _double;
}
-
- /**
- **/
public FormatTest string(String string) {
this.string = string;
return this;
}
-
+
+ /**
+ * Get string
+ * @return string
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("string")
public String getString() {
return string;
}
+
public void setString(String string) {
this.string = string;
}
-
- /**
- **/
public FormatTest _byte(byte[] _byte) {
this._byte = _byte;
return this;
}
-
+
+ /**
+ * Get _byte
+ * @return _byte
+ **/
@ApiModelProperty(example = "null", required = true, value = "")
- @JsonProperty("byte")
public byte[] getByte() {
return _byte;
}
+
public void setByte(byte[] _byte) {
this._byte = _byte;
}
-
- /**
- **/
public FormatTest binary(byte[] binary) {
this.binary = binary;
return this;
}
-
+
+ /**
+ * Get binary
+ * @return binary
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("binary")
public byte[] getBinary() {
return binary;
}
+
public void setBinary(byte[] binary) {
this.binary = binary;
}
-
- /**
- **/
public FormatTest date(LocalDate date) {
this.date = date;
return this;
}
-
+
+ /**
+ * Get date
+ * @return date
+ **/
@ApiModelProperty(example = "null", required = true, value = "")
- @JsonProperty("date")
public LocalDate getDate() {
return date;
}
+
public void setDate(LocalDate date) {
this.date = date;
}
-
- /**
- **/
public FormatTest dateTime(DateTime dateTime) {
this.dateTime = dateTime;
return this;
}
-
+
+ /**
+ * Get dateTime
+ * @return dateTime
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("dateTime")
public DateTime getDateTime() {
return dateTime;
}
+
public void setDateTime(DateTime dateTime) {
this.dateTime = dateTime;
}
-
- /**
- **/
public FormatTest uuid(String uuid) {
this.uuid = uuid;
return this;
}
-
+
+ /**
+ * Get uuid
+ * @return uuid
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("uuid")
public String getUuid() {
return uuid;
}
+
public void setUuid(String uuid) {
this.uuid = uuid;
}
-
- /**
- **/
public FormatTest password(String password) {
this.password = password;
return this;
}
-
+
+ /**
+ * Get password
+ * @return password
+ **/
@ApiModelProperty(example = "null", required = true, value = "")
- @JsonProperty("password")
public String getPassword() {
return password;
}
+
public void setPassword(String password) {
this.password = password;
}
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java
new file mode 100644
index 00000000000..d77fc7ac36b
--- /dev/null
+++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java
@@ -0,0 +1,104 @@
+/**
+ * Swagger Petstore
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: apiteam@swagger.io
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package io.swagger.client.model;
+
+import java.util.Objects;
+import com.google.gson.annotations.SerializedName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+
+/**
+ * HasOnlyReadOnly
+ */
+
+public class HasOnlyReadOnly {
+ @SerializedName("bar")
+ private String bar = null;
+
+ @SerializedName("foo")
+ private String foo = null;
+
+ /**
+ * Get bar
+ * @return bar
+ **/
+ @ApiModelProperty(example = "null", value = "")
+ public String getBar() {
+ return bar;
+ }
+
+ /**
+ * Get foo
+ * @return foo
+ **/
+ @ApiModelProperty(example = "null", value = "")
+ public String getFoo() {
+ return foo;
+ }
+
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o;
+ return Objects.equals(this.bar, hasOnlyReadOnly.bar) &&
+ Objects.equals(this.foo, hasOnlyReadOnly.foo);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(bar, foo);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class HasOnlyReadOnly {\n");
+
+ sb.append(" bar: ").append(toIndentedString(bar)).append("\n");
+ sb.append(" foo: ").append(toIndentedString(foo)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MapTest.java
new file mode 100644
index 00000000000..61bdb6b2c65
--- /dev/null
+++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MapTest.java
@@ -0,0 +1,147 @@
+/**
+ * Swagger Petstore
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: apiteam@swagger.io
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package io.swagger.client.model;
+
+import java.util.Objects;
+import com.google.gson.annotations.SerializedName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * MapTest
+ */
+
+public class MapTest {
+ @SerializedName("map_map_of_string")
+ private Map> mapMapOfString = new HashMap>();
+
+ /**
+ * Gets or Sets inner
+ */
+ public enum InnerEnum {
+ @SerializedName("UPPER")
+ UPPER("UPPER"),
+
+ @SerializedName("lower")
+ LOWER("lower");
+
+ private String value;
+
+ InnerEnum(String value) {
+ this.value = value;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+ }
+
+ @SerializedName("map_of_enum_string")
+ private Map mapOfEnumString = new HashMap();
+
+ public MapTest mapMapOfString(Map> mapMapOfString) {
+ this.mapMapOfString = mapMapOfString;
+ return this;
+ }
+
+ /**
+ * Get mapMapOfString
+ * @return mapMapOfString
+ **/
+ @ApiModelProperty(example = "null", value = "")
+ public Map> getMapMapOfString() {
+ return mapMapOfString;
+ }
+
+ public void setMapMapOfString(Map> mapMapOfString) {
+ this.mapMapOfString = mapMapOfString;
+ }
+
+ public MapTest mapOfEnumString(Map mapOfEnumString) {
+ this.mapOfEnumString = mapOfEnumString;
+ return this;
+ }
+
+ /**
+ * Get mapOfEnumString
+ * @return mapOfEnumString
+ **/
+ @ApiModelProperty(example = "null", value = "")
+ public Map getMapOfEnumString() {
+ return mapOfEnumString;
+ }
+
+ public void setMapOfEnumString(Map mapOfEnumString) {
+ this.mapOfEnumString = mapOfEnumString;
+ }
+
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ MapTest mapTest = (MapTest) o;
+ return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) &&
+ Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(mapMapOfString, mapOfEnumString);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class MapTest {\n");
+
+ sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n");
+ sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java
index 2f0972bf41e..6e587b1bf97 100644
--- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java
+++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java
@@ -1,8 +1,32 @@
+/**
+ * Swagger Petstore
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: apiteam@swagger.io
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
package io.swagger.client.model;
-import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.client.model.Animal;
@@ -17,58 +41,65 @@ import org.joda.time.DateTime;
*/
public class MixedPropertiesAndAdditionalPropertiesClass {
-
+ @SerializedName("uuid")
private String uuid = null;
+
+ @SerializedName("dateTime")
private DateTime dateTime = null;
+
+ @SerializedName("map")
private Map map = new HashMap();
-
- /**
- **/
public MixedPropertiesAndAdditionalPropertiesClass uuid(String uuid) {
this.uuid = uuid;
return this;
}
-
+
+ /**
+ * Get uuid
+ * @return uuid
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("uuid")
public String getUuid() {
return uuid;
}
+
public void setUuid(String uuid) {
this.uuid = uuid;
}
-
- /**
- **/
public MixedPropertiesAndAdditionalPropertiesClass dateTime(DateTime dateTime) {
this.dateTime = dateTime;
return this;
}
-
+
+ /**
+ * Get dateTime
+ * @return dateTime
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("dateTime")
public DateTime getDateTime() {
return dateTime;
}
+
public void setDateTime(DateTime dateTime) {
this.dateTime = dateTime;
}
-
- /**
- **/
public MixedPropertiesAndAdditionalPropertiesClass map(Map map) {
this.map = map;
return this;
}
-
+
+ /**
+ * Get map
+ * @return map
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("map")
public Map getMap() {
return map;
}
+
public void setMap(Map map) {
this.map = map;
}
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Model200Response.java
index eed3902b922..d8da58aca9c 100644
--- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Model200Response.java
+++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Model200Response.java
@@ -1,8 +1,32 @@
+/**
+ * Swagger Petstore
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: apiteam@swagger.io
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
package io.swagger.client.model;
-import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -13,40 +37,44 @@ import io.swagger.annotations.ApiModelProperty;
@ApiModel(description = "Model for testing model name starting with number")
public class Model200Response {
-
+ @SerializedName("name")
private Integer name = null;
+
+ @SerializedName("class")
private String PropertyClass = null;
-
- /**
- **/
public Model200Response name(Integer name) {
this.name = name;
return this;
}
-
+
+ /**
+ * Get name
+ * @return name
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("name")
public Integer getName() {
return name;
}
+
public void setName(Integer name) {
this.name = name;
}
-
- /**
- **/
public Model200Response PropertyClass(String PropertyClass) {
this.PropertyClass = PropertyClass;
return this;
}
-
+
+ /**
+ * Get PropertyClass
+ * @return PropertyClass
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("class")
public String getPropertyClass() {
return PropertyClass;
}
+
public void setPropertyClass(String PropertyClass) {
this.PropertyClass = PropertyClass;
}
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelApiResponse.java
index 32fb86dd323..2a823298323 100644
--- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelApiResponse.java
+++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelApiResponse.java
@@ -1,8 +1,32 @@
+/**
+ * Swagger Petstore
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: apiteam@swagger.io
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
package io.swagger.client.model;
-import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -12,58 +36,65 @@ import io.swagger.annotations.ApiModelProperty;
*/
public class ModelApiResponse {
-
+ @SerializedName("code")
private Integer code = null;
+
+ @SerializedName("type")
private String type = null;
+
+ @SerializedName("message")
private String message = null;
-
- /**
- **/
public ModelApiResponse code(Integer code) {
this.code = code;
return this;
}
-
+
+ /**
+ * Get code
+ * @return code
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("code")
public Integer getCode() {
return code;
}
+
public void setCode(Integer code) {
this.code = code;
}
-
- /**
- **/
public ModelApiResponse type(String type) {
this.type = type;
return this;
}
-
+
+ /**
+ * Get type
+ * @return type
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("type")
public String getType() {
return type;
}
+
public void setType(String type) {
this.type = type;
}
-
- /**
- **/
public ModelApiResponse message(String message) {
this.message = message;
return this;
}
-
+
+ /**
+ * Get message
+ * @return message
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("message")
public String getMessage() {
return message;
}
+
public void setMessage(String message) {
this.message = message;
}
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelReturn.java
index a076d16f964..024a9c0df1c 100644
--- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelReturn.java
+++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelReturn.java
@@ -1,8 +1,32 @@
+/**
+ * Swagger Petstore
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: apiteam@swagger.io
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
package io.swagger.client.model;
-import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -13,22 +37,23 @@ import io.swagger.annotations.ApiModelProperty;
@ApiModel(description = "Model for testing reserved words")
public class ModelReturn {
-
+ @SerializedName("return")
private Integer _return = null;
-
- /**
- **/
public ModelReturn _return(Integer _return) {
this._return = _return;
return this;
}
-
+
+ /**
+ * Get _return
+ * @return _return
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("return")
public Integer getReturn() {
return _return;
}
+
public void setReturn(Integer _return) {
this._return = _return;
}
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Name.java
index 1ba2cc5e4a3..318a2ddd50e 100644
--- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Name.java
+++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Name.java
@@ -1,8 +1,32 @@
+/**
+ * Swagger Petstore
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: apiteam@swagger.io
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
package io.swagger.client.model;
-import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -13,56 +37,68 @@ import io.swagger.annotations.ApiModelProperty;
@ApiModel(description = "Model for testing model name same as property name")
public class Name {
-
+ @SerializedName("name")
private Integer name = null;
+
+ @SerializedName("snake_case")
private Integer snakeCase = null;
+
+ @SerializedName("property")
private String property = null;
+
+ @SerializedName("123Number")
private Integer _123Number = null;
-
- /**
- **/
public Name name(Integer name) {
this.name = name;
return this;
}
-
+
+ /**
+ * Get name
+ * @return name
+ **/
@ApiModelProperty(example = "null", required = true, value = "")
- @JsonProperty("name")
public Integer getName() {
return name;
}
+
public void setName(Integer name) {
this.name = name;
}
-
+ /**
+ * Get snakeCase
+ * @return snakeCase
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("snake_case")
public Integer getSnakeCase() {
return snakeCase;
}
-
- /**
- **/
public Name property(String property) {
this.property = property;
return this;
}
-
+
+ /**
+ * Get property
+ * @return property
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("property")
public String getProperty() {
return property;
}
+
public void setProperty(String property) {
this.property = property;
}
-
+ /**
+ * Get _123Number
+ * @return _123Number
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("123Number")
public Integer get123Number() {
return _123Number;
}
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/NumberOnly.java
new file mode 100644
index 00000000000..9b9ca048dfb
--- /dev/null
+++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/NumberOnly.java
@@ -0,0 +1,100 @@
+/**
+ * Swagger Petstore
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: apiteam@swagger.io
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package io.swagger.client.model;
+
+import java.util.Objects;
+import com.google.gson.annotations.SerializedName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.math.BigDecimal;
+
+
+/**
+ * NumberOnly
+ */
+
+public class NumberOnly {
+ @SerializedName("JustNumber")
+ private BigDecimal justNumber = null;
+
+ public NumberOnly justNumber(BigDecimal justNumber) {
+ this.justNumber = justNumber;
+ return this;
+ }
+
+ /**
+ * Get justNumber
+ * @return justNumber
+ **/
+ @ApiModelProperty(example = "null", value = "")
+ public BigDecimal getJustNumber() {
+ return justNumber;
+ }
+
+ public void setJustNumber(BigDecimal justNumber) {
+ this.justNumber = justNumber;
+ }
+
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ NumberOnly numberOnly = (NumberOnly) o;
+ return Objects.equals(this.justNumber, numberOnly.justNumber);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(justNumber);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class NumberOnly {\n");
+
+ sb.append(" justNumber: ").append(toIndentedString(justNumber)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(java.lang.Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
+
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Order.java
index cec651e73a6..90cfd2f3892 100644
--- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Order.java
+++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Order.java
@@ -1,9 +1,32 @@
+/**
+ * Swagger Petstore
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: apiteam@swagger.io
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
package io.swagger.client.model;
-import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonValue;
+import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.joda.time.DateTime;
@@ -14,18 +37,29 @@ import org.joda.time.DateTime;
*/
public class Order {
-
+ @SerializedName("id")
private Long id = null;
+
+ @SerializedName("petId")
private Long petId = null;
+
+ @SerializedName("quantity")
private Integer quantity = null;
+
+ @SerializedName("shipDate")
private DateTime shipDate = null;
/**
* Order Status
*/
public enum StatusEnum {
+ @SerializedName("placed")
PLACED("placed"),
+
+ @SerializedName("approved")
APPROVED("approved"),
+
+ @SerializedName("delivered")
DELIVERED("delivered");
private String value;
@@ -35,114 +69,121 @@ public class Order {
}
@Override
- @JsonValue
public String toString() {
return String.valueOf(value);
}
}
+ @SerializedName("status")
private StatusEnum status = null;
+
+ @SerializedName("complete")
private Boolean complete = false;
-
- /**
- **/
public Order id(Long id) {
this.id = id;
return this;
}
-
+
+ /**
+ * Get id
+ * @return id
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("id")
public Long getId() {
return id;
}
+
public void setId(Long id) {
this.id = id;
}
-
- /**
- **/
public Order petId(Long petId) {
this.petId = petId;
return this;
}
-
+
+ /**
+ * Get petId
+ * @return petId
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("petId")
public Long getPetId() {
return petId;
}
+
public void setPetId(Long petId) {
this.petId = petId;
}
-
- /**
- **/
public Order quantity(Integer quantity) {
this.quantity = quantity;
return this;
}
-
+
+ /**
+ * Get quantity
+ * @return quantity
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("quantity")
public Integer getQuantity() {
return quantity;
}
+
public void setQuantity(Integer quantity) {
this.quantity = quantity;
}
-
- /**
- **/
public Order shipDate(DateTime shipDate) {
this.shipDate = shipDate;
return this;
}
-
+
+ /**
+ * Get shipDate
+ * @return shipDate
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("shipDate")
public DateTime getShipDate() {
return shipDate;
}
+
public void setShipDate(DateTime shipDate) {
this.shipDate = shipDate;
}
-
- /**
- * Order Status
- **/
public Order status(StatusEnum status) {
this.status = status;
return this;
}
-
+
+ /**
+ * Order Status
+ * @return status
+ **/
@ApiModelProperty(example = "null", value = "Order Status")
- @JsonProperty("status")
public StatusEnum getStatus() {
return status;
}
+
public void setStatus(StatusEnum status) {
this.status = status;
}
-
- /**
- **/
public Order complete(Boolean complete) {
this.complete = complete;
return this;
}
-
+
+ /**
+ * Get complete
+ * @return complete
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("complete")
public Boolean getComplete() {
return complete;
}
+
public void setComplete(Boolean complete) {
this.complete = complete;
}
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Pet.java
index da8b76ad024..b80fdeaf923 100644
--- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Pet.java
+++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Pet.java
@@ -1,9 +1,32 @@
+/**
+ * Swagger Petstore
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: apiteam@swagger.io
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
package io.swagger.client.model;
-import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonValue;
+import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.client.model.Category;
@@ -17,19 +40,32 @@ import java.util.List;
*/
public class Pet {
-
+ @SerializedName("id")
private Long id = null;
+
+ @SerializedName("category")
private Category category = null;
+
+ @SerializedName("name")
private String name = null;
+
+ @SerializedName("photoUrls")
private List photoUrls = new ArrayList();
+
+ @SerializedName("tags")
private List tags = new ArrayList();
/**
* pet status in the store
*/
public enum StatusEnum {
+ @SerializedName("available")
AVAILABLE("available"),
+
+ @SerializedName("pending")
PENDING("pending"),
+
+ @SerializedName("sold")
SOLD("sold");
private String value;
@@ -39,113 +75,118 @@ public class Pet {
}
@Override
- @JsonValue
public String toString() {
return String.valueOf(value);
}
}
+ @SerializedName("status")
private StatusEnum status = null;
-
- /**
- **/
public Pet id(Long id) {
this.id = id;
return this;
}
-
+
+ /**
+ * Get id
+ * @return id
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("id")
public Long getId() {
return id;
}
+
public void setId(Long id) {
this.id = id;
}
-
- /**
- **/
public Pet category(Category category) {
this.category = category;
return this;
}
-
+
+ /**
+ * Get category
+ * @return category
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("category")
public Category getCategory() {
return category;
}
+
public void setCategory(Category category) {
this.category = category;
}
-
- /**
- **/
public Pet name(String name) {
this.name = name;
return this;
}
-
+
+ /**
+ * Get name
+ * @return name
+ **/
@ApiModelProperty(example = "doggie", required = true, value = "")
- @JsonProperty("name")
public String getName() {
return name;
}
+
public void setName(String name) {
this.name = name;
}
-
- /**
- **/
public Pet photoUrls(List photoUrls) {
this.photoUrls = photoUrls;
return this;
}
-
+
+ /**
+ * Get photoUrls
+ * @return photoUrls
+ **/
@ApiModelProperty(example = "null", required = true, value = "")
- @JsonProperty("photoUrls")
public List getPhotoUrls() {
return photoUrls;
}
+
public void setPhotoUrls(List photoUrls) {
this.photoUrls = photoUrls;
}
-
- /**
- **/
public Pet tags(List tags) {
this.tags = tags;
return this;
}
-
+
+ /**
+ * Get tags
+ * @return tags
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("tags")
public List getTags() {
return tags;
}
+
public void setTags(List tags) {
this.tags = tags;
}
-
- /**
- * pet status in the store
- **/
public Pet status(StatusEnum status) {
this.status = status;
return this;
}
-
+
+ /**
+ * pet status in the store
+ * @return status
+ **/
@ApiModelProperty(example = "null", value = "pet status in the store")
- @JsonProperty("status")
public StatusEnum getStatus() {
return status;
}
+
public void setStatus(StatusEnum status) {
this.status = status;
}
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ReadOnlyFirst.java
index fdc3587df0e..13b729bb94d 100644
--- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ReadOnlyFirst.java
+++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ReadOnlyFirst.java
@@ -1,8 +1,32 @@
+/**
+ * Swagger Petstore
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: apiteam@swagger.io
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
package io.swagger.client.model;
-import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -12,30 +36,35 @@ import io.swagger.annotations.ApiModelProperty;
*/
public class ReadOnlyFirst {
-
+ @SerializedName("bar")
private String bar = null;
+
+ @SerializedName("baz")
private String baz = null;
-
+ /**
+ * Get bar
+ * @return bar
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("bar")
public String getBar() {
return bar;
}
-
- /**
- **/
public ReadOnlyFirst baz(String baz) {
this.baz = baz;
return this;
}
-
+
+ /**
+ * Get baz
+ * @return baz
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("baz")
public String getBaz() {
return baz;
}
+
public void setBaz(String baz) {
this.baz = baz;
}
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/SpecialModelName.java
index 24e57756cb2..b46b8367a01 100644
--- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/SpecialModelName.java
+++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/SpecialModelName.java
@@ -1,8 +1,32 @@
+/**
+ * Swagger Petstore
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: apiteam@swagger.io
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
package io.swagger.client.model;
-import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -12,22 +36,23 @@ import io.swagger.annotations.ApiModelProperty;
*/
public class SpecialModelName {
-
+ @SerializedName("$special[property.name]")
private Long specialPropertyName = null;
-
- /**
- **/
public SpecialModelName specialPropertyName(Long specialPropertyName) {
this.specialPropertyName = specialPropertyName;
return this;
}
-
+
+ /**
+ * Get specialPropertyName
+ * @return specialPropertyName
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("$special[property.name]")
public Long getSpecialPropertyName() {
return specialPropertyName;
}
+
public void setSpecialPropertyName(Long specialPropertyName) {
this.specialPropertyName = specialPropertyName;
}
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Tag.java
index 9d3bdd8cb9e..e56eb535d1e 100644
--- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Tag.java
+++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Tag.java
@@ -1,8 +1,32 @@
+/**
+ * Swagger Petstore
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: apiteam@swagger.io
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
package io.swagger.client.model;
-import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -12,40 +36,44 @@ import io.swagger.annotations.ApiModelProperty;
*/
public class Tag {
-
+ @SerializedName("id")
private Long id = null;
+
+ @SerializedName("name")
private String name = null;
-
- /**
- **/
public Tag id(Long id) {
this.id = id;
return this;
}
-
+
+ /**
+ * Get id
+ * @return id
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("id")
public Long getId() {
return id;
}
+
public void setId(Long id) {
this.id = id;
}
-
- /**
- **/
public Tag name(String name) {
this.name = name;
return this;
}
-
+
+ /**
+ * Get name
+ * @return name
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("name")
public String getName() {
return name;
}
+
public void setName(String name) {
this.name = name;
}
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/User.java
index f23553660de..6c1ed6ceacc 100644
--- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/User.java
+++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/User.java
@@ -1,8 +1,32 @@
+/**
+ * Swagger Petstore
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: apiteam@swagger.io
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
package io.swagger.client.model;
-import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -12,149 +36,170 @@ import io.swagger.annotations.ApiModelProperty;
*/
public class User {
-
+ @SerializedName("id")
private Long id = null;
+
+ @SerializedName("username")
private String username = null;
+
+ @SerializedName("firstName")
private String firstName = null;
+
+ @SerializedName("lastName")
private String lastName = null;
+
+ @SerializedName("email")
private String email = null;
+
+ @SerializedName("password")
private String password = null;
+
+ @SerializedName("phone")
private String phone = null;
+
+ @SerializedName("userStatus")
private Integer userStatus = null;
-
- /**
- **/
public User id(Long id) {
this.id = id;
return this;
}
-
+
+ /**
+ * Get id
+ * @return id
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("id")
public Long getId() {
return id;
}
+
public void setId(Long id) {
this.id = id;
}
-
- /**
- **/
public User username(String username) {
this.username = username;
return this;
}
-
+
+ /**
+ * Get username
+ * @return username
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("username")
public String getUsername() {
return username;
}
+
public void setUsername(String username) {
this.username = username;
}
-
- /**
- **/
public User firstName(String firstName) {
this.firstName = firstName;
return this;
}
-
+
+ /**
+ * Get firstName
+ * @return firstName
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("firstName")
public String getFirstName() {
return firstName;
}
+
public void setFirstName(String firstName) {
this.firstName = firstName;
}
-
- /**
- **/
public User lastName(String lastName) {
this.lastName = lastName;
return this;
}
-
+
+ /**
+ * Get lastName
+ * @return lastName
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("lastName")
public String getLastName() {
return lastName;
}
+
public void setLastName(String lastName) {
this.lastName = lastName;
}
-
- /**
- **/
public User email(String email) {
this.email = email;
return this;
}
-
+
+ /**
+ * Get email
+ * @return email
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("email")
public String getEmail() {
return email;
}
+
public void setEmail(String email) {
this.email = email;
}
-
- /**
- **/
public User password(String password) {
this.password = password;
return this;
}
-
+
+ /**
+ * Get password
+ * @return password
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("password")
public String getPassword() {
return password;
}
+
public void setPassword(String password) {
this.password = password;
}
-
- /**
- **/
public User phone(String phone) {
this.phone = phone;
return this;
}
-
+
+ /**
+ * Get phone
+ * @return phone
+ **/
@ApiModelProperty(example = "null", value = "")
- @JsonProperty("phone")
public String getPhone() {
return phone;
}
+
public void setPhone(String phone) {
this.phone = phone;
}
-
- /**
- * User Status
- **/
public User userStatus(Integer userStatus) {
this.userStatus = userStatus;
return this;
}
-
+
+ /**
+ * User Status
+ * @return userStatus
+ **/
@ApiModelProperty(example = "null", value = "User Status")
- @JsonProperty("userStatus")
public Integer getUserStatus() {
return userStatus;
}
+
public void setUserStatus(Integer userStatus) {
this.userStatus = userStatus;
}
diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/ApiClient.java
index 0204c5c96aa..b7b04e3e4c5 100644
--- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/ApiClient.java
+++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/ApiClient.java
@@ -812,6 +812,7 @@ public class ApiClient {
* @throws ApiException If fail to deserialize response body, i.e. cannot read response body
* or the Content-Type of the response is not supported.
*/
+ @SuppressWarnings("unchecked")
public T deserialize(Response response, Type returnType) throws ApiException {
if (response == null || returnType == null) {
return null;
@@ -1006,6 +1007,7 @@ public class ApiClient {
* @param returnType Return type
* @param callback ApiCallback
*/
+ @SuppressWarnings("unchecked")
public void executeAsync(Call call, final Type returnType, final ApiCallback callback) {
call.enqueue(new Callback() {
@Override
diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/JSON.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/JSON.java
index a0b9c9c1cf0..540611eab9d 100644
--- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/JSON.java
+++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/JSON.java
@@ -103,6 +103,7 @@ public class JSON {
* @param returnType The type to deserialize inot
* @return The deserialized Java object
*/
+ @SuppressWarnings("unchecked")
public T deserialize(String body, Type returnType) {
try {
if (apiClient.isLenientOnJson()) {
diff --git a/samples/client/petstore/java/jersey2-java8/build.gradle b/samples/client/petstore/java/jersey2-java8/build.gradle
index ece2fa55d57..45cca63a19d 100644
--- a/samples/client/petstore/java/jersey2-java8/build.gradle
+++ b/samples/client/petstore/java/jersey2-java8/build.gradle
@@ -32,8 +32,8 @@ if(hasProperty('target') && target == 'android') {
targetSdkVersion 23
}
compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_8
- targetCompatibility JavaVersion.VERSION_1_8
+ sourceCompatibility JavaVersion.VERSION_1_7
+ targetCompatibility JavaVersion.VERSION_1_7
}
// Rename the aar correctly
@@ -77,6 +77,7 @@ if(hasProperty('target') && target == 'android') {
apply plugin: 'java'
apply plugin: 'maven'
+
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
@@ -92,22 +93,10 @@ if(hasProperty('target') && target == 'android') {
}
}
-ext {
- swagger_annotations_version = "1.5.8"
- jackson_version = "2.7.5"
- jersey_version = "2.22.2"
- junit_version = "4.12"
-}
-
dependencies {
- compile "io.swagger:swagger-annotations:$swagger_annotations_version"
- compile "org.glassfish.jersey.core:jersey-client:$jersey_version"
- compile "org.glassfish.jersey.media:jersey-media-multipart:$jersey_version"
- compile "org.glassfish.jersey.media:jersey-media-json-jackson:$jersey_version"
- compile "com.fasterxml.jackson.core:jackson-core:$jackson_version"
- compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version"
- compile "com.fasterxml.jackson.core:jackson-databind:$jackson_version"
- compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version"
- compile "com.brsanthu:migbase64:2.2"
- testCompile "junit:junit:$junit_version"
+ compile 'io.swagger:swagger-annotations:1.5.8'
+ compile 'com.squareup.okhttp:okhttp:2.7.5'
+ compile 'com.squareup.okhttp:logging-interceptor:2.7.5'
+ compile 'com.google.code.gson:gson:2.6.2'
+ testCompile 'junit:junit:4.12'
}
diff --git a/samples/client/petstore/java/jersey2-java8/build.sbt b/samples/client/petstore/java/jersey2-java8/build.sbt
index b187fb67ae2..45814b8a5cc 100644
--- a/samples/client/petstore/java/jersey2-java8/build.sbt
+++ b/samples/client/petstore/java/jersey2-java8/build.sbt
@@ -10,14 +10,9 @@ lazy val root = (project in file(".")).
resolvers += Resolver.mavenLocal,
libraryDependencies ++= Seq(
"io.swagger" % "swagger-annotations" % "1.5.8",
- "org.glassfish.jersey.core" % "jersey-client" % "2.22.2",
- "org.glassfish.jersey.media" % "jersey-media-multipart" % "2.22.2",
- "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.22.2",
- "com.fasterxml.jackson.core" % "jackson-core" % "2.7.5",
- "com.fasterxml.jackson.core" % "jackson-annotations" % "2.7.5",
- "com.fasterxml.jackson.core" % "jackson-databind" % "2.7.5",
- "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.7.5",
- "com.brsanthu" % "migbase64" % "2.2",
+ "com.squareup.okhttp" % "okhttp" % "2.7.5",
+ "com.squareup.okhttp" % "logging-interceptor" % "2.7.5",
+ "com.google.code.gson" % "gson" % "2.6.2",
"junit" % "junit" % "4.12" % "test",
"com.novocode" % "junit-interface" % "0.10" % "test"
)
diff --git a/samples/client/petstore/java/jersey2-java8/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java/jersey2-java8/docs/ArrayOfArrayOfNumberOnly.md
new file mode 100644
index 00000000000..77292549927
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8/docs/ArrayOfArrayOfNumberOnly.md
@@ -0,0 +1,10 @@
+
+# ArrayOfArrayOfNumberOnly
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**arrayArrayNumber** | [**List<List<BigDecimal>>**](List.md) | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java/jersey2-java8/docs/ArrayOfNumberOnly.md
new file mode 100644
index 00000000000..e8cc4cd36dc
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8/docs/ArrayOfNumberOnly.md
@@ -0,0 +1,10 @@
+
+# ArrayOfNumberOnly
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**arrayNumber** | [**List<BigDecimal>**](BigDecimal.md) | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8/docs/FakeApi.md b/samples/client/petstore/java/jersey2-java8/docs/FakeApi.md
index 0e2b14922de..678a0f76a82 100644
--- a/samples/client/petstore/java/jersey2-java8/docs/FakeApi.md
+++ b/samples/client/petstore/java/jersey2-java8/docs/FakeApi.md
@@ -5,6 +5,7 @@ All URIs are relative to *http://petstore.swagger.io/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+[**testEnumQueryParameters**](FakeApi.md#testEnumQueryParameters) | **GET** /fake | To test enum query parameters
@@ -73,3 +74,49 @@ No authorization required
- **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8
- **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8
+
+# **testEnumQueryParameters**
+> testEnumQueryParameters(enumQueryString, enumQueryInteger, enumQueryDouble)
+
+To test enum query parameters
+
+### Example
+```java
+// Import classes:
+//import io.swagger.client.ApiException;
+//import io.swagger.client.api.FakeApi;
+
+
+FakeApi apiInstance = new FakeApi();
+String enumQueryString = "-efg"; // String | Query parameter enum test (string)
+BigDecimal enumQueryInteger = new BigDecimal(); // BigDecimal | Query parameter enum test (double)
+Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double)
+try {
+ apiInstance.testEnumQueryParameters(enumQueryString, enumQueryInteger, enumQueryDouble);
+} catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#testEnumQueryParameters");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
+ **enumQueryInteger** | **BigDecimal**| Query parameter enum test (double) | [optional]
+ **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional]
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
diff --git a/samples/client/petstore/java/jersey2-java8/docs/HasOnlyReadOnly.md b/samples/client/petstore/java/jersey2-java8/docs/HasOnlyReadOnly.md
new file mode 100644
index 00000000000..c1d0aac5672
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8/docs/HasOnlyReadOnly.md
@@ -0,0 +1,11 @@
+
+# HasOnlyReadOnly
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**bar** | **String** | | [optional]
+**foo** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8/docs/MapTest.md b/samples/client/petstore/java/jersey2-java8/docs/MapTest.md
new file mode 100644
index 00000000000..c671e97ffbc
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8/docs/MapTest.md
@@ -0,0 +1,17 @@
+
+# MapTest
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional]
+**mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional]
+
+
+
+## Enum: Map<String, InnerEnum>
+Name | Value
+---- | -----
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8/docs/Model200Response.md b/samples/client/petstore/java/jersey2-java8/docs/Model200Response.md
index 0819b88c4f4..b47618b28cc 100644
--- a/samples/client/petstore/java/jersey2-java8/docs/Model200Response.md
+++ b/samples/client/petstore/java/jersey2-java8/docs/Model200Response.md
@@ -5,6 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **Integer** | | [optional]
+**PropertyClass** | **String** | | [optional]
diff --git a/samples/client/petstore/java/jersey2-java8/docs/NumberOnly.md b/samples/client/petstore/java/jersey2-java8/docs/NumberOnly.md
new file mode 100644
index 00000000000..a3feac7fadc
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8/docs/NumberOnly.md
@@ -0,0 +1,10 @@
+
+# NumberOnly
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**justNumber** | [**BigDecimal**](BigDecimal.md) | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/jersey2-java8/gradlew.bat b/samples/client/petstore/java/jersey2-java8/gradlew.bat
index 5f192121eb4..72d362dafd8 100644
--- a/samples/client/petstore/java/jersey2-java8/gradlew.bat
+++ b/samples/client/petstore/java/jersey2-java8/gradlew.bat
@@ -1,90 +1,90 @@
-@if "%DEBUG%" == "" @echo off
-@rem ##########################################################################
-@rem
-@rem Gradle startup script for Windows
-@rem
-@rem ##########################################################################
-
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
-
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
-
-set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@rem Find java.exe
-if defined JAVA_HOME goto findJavaFromJavaHome
-
-set JAVA_EXE=java.exe
-%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto init
-
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto init
-
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:init
-@rem Get command-line arguments, handling Windows variants
-
-if not "%OS%" == "Windows_NT" goto win9xME_args
-if "%@eval[2+2]" == "4" goto 4NT_args
-
-:win9xME_args
-@rem Slurp the command line arguments.
-set CMD_LINE_ARGS=
-set _SKIP=2
-
-:win9xME_args_slurp
-if "x%~1" == "x" goto execute
-
-set CMD_LINE_ARGS=%*
-goto execute
-
-:4NT_args
-@rem Get arguments from the 4NT Shell from JP Software
-set CMD_LINE_ARGS=%$
-
-:execute
-@rem Setup the command line
-
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
-
-@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
-
-:end
-@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
-
-:fail
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
-rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
-
-:mainEnd
-if "%OS%"=="Windows_NT" endlocal
-
-:omega
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/samples/client/petstore/java/jersey2-java8/pom.xml b/samples/client/petstore/java/jersey2-java8/pom.xml
index d3327ef4b98..9bf4ed63d67 100644
--- a/samples/client/petstore/java/jersey2-java8/pom.xml
+++ b/samples/client/petstore/java/jersey2-java8/pom.xml
@@ -52,7 +52,7 @@
org.apache.maven.plugins
maven-jar-plugin
- 2.6
+ 2.2
@@ -68,6 +68,7 @@
org.codehaus.mojo
build-helper-maven-plugin
+ 1.10
add_sources
@@ -95,15 +96,6 @@
-
- org.apache.maven.plugins
- maven-compiler-plugin
- 2.5.1
-
- 1.8
- 1.8
-
-
@@ -112,51 +104,20 @@
swagger-annotations
${swagger-core-version}
-
-
- org.glassfish.jersey.core
- jersey-client
- ${jersey-version}
+ com.squareup.okhttp
+ okhttp
+ ${okhttp-version}
- org.glassfish.jersey.media
- jersey-media-multipart
- ${jersey-version}
+ com.squareup.okhttp
+ logging-interceptor
+ ${okhttp-version}
- org.glassfish.jersey.media
- jersey-media-json-jackson
- ${jersey-version}
-
-
-
-
- com.fasterxml.jackson.core
- jackson-core
- ${jackson-version}
-
-
- com.fasterxml.jackson.core
- jackson-annotations
- ${jackson-version}
-
-
- com.fasterxml.jackson.core
- jackson-databind
- ${jackson-version}
-
-
- com.fasterxml.jackson.datatype
- jackson-datatype-jsr310
- ${jackson-version}
-
-
-
-
- com.brsanthu
- migbase64
- 2.2
+ com.google.code.gson
+ gson
+ ${gson-version}
@@ -168,10 +129,15 @@
- 1.5.8
- 2.22.2
- 2.7.5
+ 1.8
+ ${java.version}
+ ${java.version}
+ 1.5.9
+ 2.7.5
+ 2.6.2
+ 2.9.3
1.0.0
4.12
+ UTF-8
diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/ApiCallback.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/ApiCallback.java
new file mode 100644
index 00000000000..3ca33cf8017
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/ApiCallback.java
@@ -0,0 +1,74 @@
+/**
+ * Swagger Petstore
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: apiteam@swagger.io
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package io.swagger.client;
+
+import java.io.IOException;
+
+import java.util.Map;
+import java.util.List;
+
+/**
+ * Callback for asynchronous API call.
+ *
+ * @param The return type
+ */
+public interface ApiCallback {
+ /**
+ * This is called when the API call fails.
+ *
+ * @param e The exception causing the failure
+ * @param statusCode Status code of the response if available, otherwise it would be 0
+ * @param responseHeaders Headers of the response if available, otherwise it would be null
+ */
+ void onFailure(ApiException e, int statusCode, Map> responseHeaders);
+
+ /**
+ * This is called when the API call succeeded.
+ *
+ * @param result The result deserialized from response
+ * @param statusCode Status code of the response
+ * @param responseHeaders Headers of the response
+ */
+ void onSuccess(T result, int statusCode, Map> responseHeaders);
+
+ /**
+ * This is called when the API upload processing.
+ *
+ * @param bytesWritten bytes Written
+ * @param contentLength content length of request body
+ * @param done write end
+ */
+ void onUploadProgress(long bytesWritten, long contentLength, boolean done);
+
+ /**
+ * This is called when the API downlond processing.
+ *
+ * @param bytesRead bytes Read
+ * @param contentLength content lenngth of the response
+ * @param done Read end
+ */
+ void onDownloadProgress(long bytesRead, long contentLength, boolean done);
+}
diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/ApiClient.java
index 06f6d4d899a..b7b04e3e4c5 100644
--- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/ApiClient.java
+++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/ApiClient.java
@@ -1,28 +1,46 @@
+/**
+ * Swagger Petstore
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: apiteam@swagger.io
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
package io.swagger.client;
-import javax.ws.rs.client.Client;
-import javax.ws.rs.client.ClientBuilder;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.client.Invocation;
-import javax.ws.rs.client.WebTarget;
-import javax.ws.rs.core.Form;
-import javax.ws.rs.core.GenericType;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status;
+import com.squareup.okhttp.Call;
+import com.squareup.okhttp.Callback;
+import com.squareup.okhttp.OkHttpClient;
+import com.squareup.okhttp.Request;
+import com.squareup.okhttp.Response;
+import com.squareup.okhttp.RequestBody;
+import com.squareup.okhttp.FormEncodingBuilder;
+import com.squareup.okhttp.MultipartBuilder;
+import com.squareup.okhttp.MediaType;
+import com.squareup.okhttp.Headers;
+import com.squareup.okhttp.internal.http.HttpMethod;
+import com.squareup.okhttp.logging.HttpLoggingInterceptor;
+import com.squareup.okhttp.logging.HttpLoggingInterceptor.Level;
-import org.glassfish.jersey.client.ClientConfig;
-import org.glassfish.jersey.client.ClientProperties;
-import org.glassfish.jersey.filter.LoggingFilter;
-import org.glassfish.jersey.jackson.JacksonFeature;
-import org.glassfish.jersey.media.multipart.FormDataBodyPart;
-import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
-import org.glassfish.jersey.media.multipart.MultiPart;
-import org.glassfish.jersey.media.multipart.MultiPartFeature;
+import java.lang.reflect.Type;
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.file.Files;
import java.util.Collection;
import java.util.Collections;
import java.util.Map;
@@ -32,667 +50,1277 @@ import java.util.List;
import java.util.ArrayList;
import java.util.Date;
import java.util.TimeZone;
+import java.util.concurrent.TimeUnit;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
import java.net.URLEncoder;
+import java.net.URLConnection;
import java.io.File;
+import java.io.InputStream;
+import java.io.IOException;
import java.io.UnsupportedEncodingException;
+import java.security.GeneralSecurityException;
+import java.security.KeyStore;
+import java.security.SecureRandom;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateException;
+import java.security.cert.CertificateFactory;
+import java.security.cert.X509Certificate;
+
import java.text.DateFormat;
import java.text.SimpleDateFormat;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
+import java.text.ParseException;
+
+import javax.net.ssl.HostnameVerifier;
+import javax.net.ssl.KeyManager;
+import javax.net.ssl.KeyManagerFactory;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSession;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.TrustManagerFactory;
+import javax.net.ssl.X509TrustManager;
+
+import okio.BufferedSink;
+import okio.Okio;
import io.swagger.client.auth.Authentication;
import io.swagger.client.auth.HttpBasicAuth;
import io.swagger.client.auth.ApiKeyAuth;
import io.swagger.client.auth.OAuth;
-
public class ApiClient {
- private Map defaultHeaderMap = new HashMap();
- private String basePath = "http://petstore.swagger.io/v2";
- private boolean debugging = false;
- private int connectionTimeout = 0;
+ public static final double JAVA_VERSION;
+ public static final boolean IS_ANDROID;
+ public static final int ANDROID_SDK_VERSION;
- private Client httpClient;
- private JSON json;
- private String tempFolderPath = null;
-
- private Map authentications;
-
- private int statusCode;
- private Map> responseHeaders;
-
- private DateFormat dateFormat;
-
- public ApiClient() {
- json = new JSON();
- httpClient = buildHttpClient(debugging);
-
- // Use RFC3339 format for date and datetime.
- // See http://xml2rfc.ietf.org/public/rfc/html/rfc3339.html#anchor14
- this.dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
-
- // Use UTC as the default time zone.
- this.dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
-
- this.json.setDateFormat((DateFormat) dateFormat.clone());
-
- // Set default User-Agent.
- setUserAgent("Swagger-Codegen/1.0.0/java");
-
- // Setup authentications (key: authentication name, value: authentication).
- authentications = new HashMap();
- authentications.put("petstore_auth", new OAuth());
- authentications.put("api_key", new ApiKeyAuth("header", "api_key"));
- // Prevent the authentications from being modified.
- authentications = Collections.unmodifiableMap(authentications);
- }
-
- /**
- * Gets the JSON instance to do JSON serialization and deserialization.
- */
- public JSON getJSON() {
- return json;
- }
-
- public Client getHttpClient() {
- return httpClient;
- }
-
- public ApiClient setHttpClient(Client httpClient) {
- this.httpClient = httpClient;
- return this;
- }
-
- public String getBasePath() {
- return basePath;
- }
-
- public ApiClient setBasePath(String basePath) {
- this.basePath = basePath;
- return this;
- }
-
- /**
- * Gets the status code of the previous request
- */
- public int getStatusCode() {
- return statusCode;
- }
-
- /**
- * Gets the response headers of the previous request
- */
- public Map> getResponseHeaders() {
- return responseHeaders;
- }
-
- /**
- * Get authentications (key: authentication name, value: authentication).
- */
- public Map getAuthentications() {
- return authentications;
- }
-
- /**
- * Get authentication for the given name.
- *
- * @param authName The authentication name
- * @return The authentication, null if not found
- */
- public Authentication getAuthentication(String authName) {
- return authentications.get(authName);
- }
-
- /**
- * Helper method to set username for the first HTTP basic authentication.
- */
- public void setUsername(String username) {
- for (Authentication auth : authentications.values()) {
- if (auth instanceof HttpBasicAuth) {
- ((HttpBasicAuth) auth).setUsername(username);
- return;
- }
- }
- throw new RuntimeException("No HTTP basic authentication configured!");
- }
-
- /**
- * Helper method to set password for the first HTTP basic authentication.
- */
- public void setPassword(String password) {
- for (Authentication auth : authentications.values()) {
- if (auth instanceof HttpBasicAuth) {
- ((HttpBasicAuth) auth).setPassword(password);
- return;
- }
- }
- throw new RuntimeException("No HTTP basic authentication configured!");
- }
-
- /**
- * Helper method to set API key value for the first API key authentication.
- */
- public void setApiKey(String apiKey) {
- for (Authentication auth : authentications.values()) {
- if (auth instanceof ApiKeyAuth) {
- ((ApiKeyAuth) auth).setApiKey(apiKey);
- return;
- }
- }
- throw new RuntimeException("No API key authentication configured!");
- }
-
- /**
- * Helper method to set API key prefix for the first API key authentication.
- */
- public void setApiKeyPrefix(String apiKeyPrefix) {
- for (Authentication auth : authentications.values()) {
- if (auth instanceof ApiKeyAuth) {
- ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix);
- return;
- }
- }
- throw new RuntimeException("No API key authentication configured!");
- }
-
- /**
- * Helper method to set access token for the first OAuth2 authentication.
- */
- public void setAccessToken(String accessToken) {
- for (Authentication auth : authentications.values()) {
- if (auth instanceof OAuth) {
- ((OAuth) auth).setAccessToken(accessToken);
- return;
- }
- }
- throw new RuntimeException("No OAuth2 authentication configured!");
- }
-
- /**
- * Set the User-Agent header's value (by adding to the default header map).
- */
- public ApiClient setUserAgent(String userAgent) {
- addDefaultHeader("User-Agent", userAgent);
- return this;
- }
-
- /**
- * Add a default header.
- *
- * @param key The header's key
- * @param value The header's value
- */
- public ApiClient addDefaultHeader(String key, String value) {
- defaultHeaderMap.put(key, value);
- return this;
- }
-
- /**
- * Check that whether debugging is enabled for this API client.
- */
- public boolean isDebugging() {
- return debugging;
- }
-
- /**
- * Enable/disable debugging for this API client.
- *
- * @param debugging To enable (true) or disable (false) debugging
- */
- public ApiClient setDebugging(boolean debugging) {
- this.debugging = debugging;
- // Rebuild HTTP Client according to the new "debugging" value.
- this.httpClient = buildHttpClient(debugging);
- return this;
- }
-
- /**
- * The path of temporary folder used to store downloaded files from endpoints
- * with file response. The default value is null
, i.e. using
- * the system's default tempopary folder.
- *
- * @see https://docs.oracle.com/javase/7/docs/api/java/io/File.html#createTempFile(java.lang.String,%20java.lang.String,%20java.io.File)
- */
- public String getTempFolderPath() {
- return tempFolderPath;
- }
-
- public ApiClient setTempFolderPath(String tempFolderPath) {
- this.tempFolderPath = tempFolderPath;
- return this;
- }
-
- /**
- * Connect timeout (in milliseconds).
- */
- public int getConnectTimeout() {
- return connectionTimeout;
- }
-
- /**
- * Set the connect timeout (in milliseconds).
- * A value of 0 means no timeout, otherwise values must be between 1 and
- * {@link Integer#MAX_VALUE}.
- */
- public ApiClient setConnectTimeout(int connectionTimeout) {
- this.connectionTimeout = connectionTimeout;
- httpClient.property(ClientProperties.CONNECT_TIMEOUT, connectionTimeout);
- return this;
- }
-
- /**
- * Get the date format used to parse/format date parameters.
- */
- public DateFormat getDateFormat() {
- return dateFormat;
- }
-
- /**
- * Set the date format used to parse/format date parameters.
- */
- public ApiClient setDateFormat(DateFormat dateFormat) {
- this.dateFormat = dateFormat;
- // also set the date format for model (de)serialization with Date properties
- this.json.setDateFormat((DateFormat) dateFormat.clone());
- return this;
- }
-
- /**
- * Parse the given string into Date object.
- */
- public Date parseDate(String str) {
- try {
- return dateFormat.parse(str);
- } catch (java.text.ParseException e) {
- throw new RuntimeException(e);
- }
- }
-
- /**
- * Format the given Date object into string.
- */
- public String formatDate(Date date) {
- return dateFormat.format(date);
- }
-
- /**
- * Format the given parameter object into string.
- */
- public String parameterToString(Object param) {
- if (param == null) {
- return "";
- } else if (param instanceof Date) {
- return formatDate((Date) param);
- } else if (param instanceof Collection) {
- StringBuilder b = new StringBuilder();
- for(Object o : (Collection)param) {
- if(b.length() > 0) {
- b.append(",");
- }
- b.append(String.valueOf(o));
- }
- return b.toString();
- } else {
- return String.valueOf(param);
- }
- }
-
- /*
- Format to {@code Pair} objects.
- */
- public List parameterToPairs(String collectionFormat, String name, Object value){
- List params = new ArrayList();
-
- // preconditions
- if (name == null || name.isEmpty() || value == null) return params;
-
- Collection valueCollection = null;
- if (value instanceof Collection) {
- valueCollection = (Collection) value;
- } else {
- params.add(new Pair(name, parameterToString(value)));
- return params;
- }
-
- if (valueCollection.isEmpty()){
- return params;
- }
-
- // get the collection format
- collectionFormat = (collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat); // default: csv
-
- // create the params based on the collection format
- if (collectionFormat.equals("multi")) {
- for (Object item : valueCollection) {
- params.add(new Pair(name, parameterToString(item)));
- }
-
- return params;
- }
-
- String delimiter = ",";
-
- if (collectionFormat.equals("csv")) {
- delimiter = ",";
- } else if (collectionFormat.equals("ssv")) {
- delimiter = " ";
- } else if (collectionFormat.equals("tsv")) {
- delimiter = "\t";
- } else if (collectionFormat.equals("pipes")) {
- delimiter = "|";
- }
-
- StringBuilder sb = new StringBuilder() ;
- for (Object item : valueCollection) {
- sb.append(delimiter);
- sb.append(parameterToString(item));
- }
-
- params.add(new Pair(name, sb.substring(1)));
-
- return params;
- }
-
- /**
- * Check if the given MIME is a JSON MIME.
- * JSON MIME examples:
- * application/json
- * application/json; charset=UTF8
- * APPLICATION/JSON
- */
- public boolean isJsonMime(String mime) {
- return mime != null && mime.matches("(?i)application\\/json(;.*)?");
- }
-
- /**
- * Select the Accept header's value from the given accepts array:
- * if JSON exists in the given array, use it;
- * otherwise use all of them (joining into a string)
- *
- * @param accepts The accepts array to select from
- * @return The Accept header to use. If the given array is empty,
- * null will be returned (not to set the Accept header explicitly).
- */
- public String selectHeaderAccept(String[] accepts) {
- if (accepts.length == 0) {
- return null;
- }
- for (String accept : accepts) {
- if (isJsonMime(accept)) {
- return accept;
- }
- }
- return StringUtil.join(accepts, ",");
- }
-
- /**
- * Select the Content-Type header's value from the given array:
- * if JSON exists in the given array, use it;
- * otherwise use the first one of the array.
- *
- * @param contentTypes The Content-Type array to select from
- * @return The Content-Type header to use. If the given array is empty,
- * JSON will be used.
- */
- public String selectHeaderContentType(String[] contentTypes) {
- if (contentTypes.length == 0) {
- return "application/json";
- }
- for (String contentType : contentTypes) {
- if (isJsonMime(contentType)) {
- return contentType;
- }
- }
- return contentTypes[0];
- }
-
- /**
- * Escape the given string to be used as URL query value.
- */
- public String escapeString(String str) {
- try {
- return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20");
- } catch (UnsupportedEncodingException e) {
- return str;
- }
- }
-
- /**
- * Serialize the given Java object into string entity according the given
- * Content-Type (only JSON is supported for now).
- */
- public Entity> serialize(Object obj, Map formParams, String contentType) throws ApiException {
- Entity> entity = null;
- if (contentType.startsWith("multipart/form-data")) {
- MultiPart multiPart = new MultiPart();
- for (Entry param: formParams.entrySet()) {
- if (param.getValue() instanceof File) {
- File file = (File) param.getValue();
- FormDataContentDisposition contentDisp = FormDataContentDisposition.name(param.getKey())
- .fileName(file.getName()).size(file.length()).build();
- multiPart.bodyPart(new FormDataBodyPart(contentDisp, file, MediaType.APPLICATION_OCTET_STREAM_TYPE));
- } else {
- FormDataContentDisposition contentDisp = FormDataContentDisposition.name(param.getKey()).build();
- multiPart.bodyPart(new FormDataBodyPart(contentDisp, parameterToString(param.getValue())));
- }
- }
- entity = Entity.entity(multiPart, MediaType.MULTIPART_FORM_DATA_TYPE);
- } else if (contentType.startsWith("application/x-www-form-urlencoded")) {
- Form form = new Form();
- for (Entry param: formParams.entrySet()) {
- form.param(param.getKey(), parameterToString(param.getValue()));
- }
- entity = Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE);
- } else {
- // We let jersey handle the serialization
- entity = Entity.entity(obj, contentType);
- }
- return entity;
- }
-
- /**
- * Deserialize response body to Java object according to the Content-Type.
- */
- public T deserialize(Response response, GenericType returnType) throws ApiException {
- // Handle file downloading.
- if (returnType.equals(File.class)) {
- @SuppressWarnings("unchecked")
- T file = (T) downloadFileFromResponse(response);
- return file;
- }
-
- String contentType = null;
- List