{
+ private ObjectMapper mapper;
+
+ public JSON() {
+ mapper = new ObjectMapper();
+ mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
+ mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+ mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
+ mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING);
+ mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING);
+ mapper.setDateFormat(new RFC3339DateFormat());
+ mapper.registerModule(new JodaModule());
+ }
+
+ /**
+ * Set the date format for JSON (de)serialization with Date properties.
+ */
+ public void setDateFormat(DateFormat dateFormat) {
+ mapper.setDateFormat(dateFormat);
+ }
+
+ @Override
+ public ObjectMapper getContext(Class> type) {
+ return mapper;
+ }
+}
diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/Pair.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/Pair.java
new file mode 100644
index 00000000000..9ad2d246519
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java6/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/jersey2-java6/src/main/java/io/swagger/client/RFC3339DateFormat.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/RFC3339DateFormat.java
new file mode 100644
index 00000000000..d662f9457d7
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/RFC3339DateFormat.java
@@ -0,0 +1,44 @@
+/*
+ * 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.fasterxml.jackson.databind.util.ISO8601DateFormat;
+import com.fasterxml.jackson.databind.util.ISO8601Utils;
+
+import java.text.FieldPosition;
+import java.util.Date;
+
+
+public class RFC3339DateFormat extends ISO8601DateFormat {
+
+ // Same as ISO8601DateFormat but serializing milliseconds.
+ @Override
+ public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
+ String value = ISO8601Utils.format(date, true);
+ toAppendTo.append(value);
+ return toAppendTo;
+ }
+
+}
\ No newline at end of file
diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/StringUtil.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/StringUtil.java
new file mode 100644
index 00000000000..31140c76df4
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/StringUtil.java
@@ -0,0 +1,67 @@
+/*
+ * 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 StringUtil {
+ /**
+ * Check if the given array contains the given value (with case-insensitive comparison).
+ *
+ * @param array The array
+ * @param value The value to search
+ * @return true if the array contains the value
+ */
+ public static boolean containsIgnoreCase(String[] array, String value) {
+ for (String str : array) {
+ if (value == null && str == null) return true;
+ if (value != null && value.equalsIgnoreCase(str)) return true;
+ }
+ return false;
+ }
+
+ /**
+ * Join an array of strings with the given separator.
+ *
+ * Note: This might be replaced by utility method from commons-lang or guava someday
+ * if one of those libraries is added as dependency.
+ *
+ *
+ * @param array The array of strings
+ * @param separator The separator
+ * @return the resulting string
+ */
+ public static String join(String[] array, String separator) {
+ int len = array.length;
+ if (len == 0) return "";
+
+ StringBuilder out = new StringBuilder();
+ out.append(array[0]);
+ for (int i = 1; i < len; i++) {
+ out.append(separator).append(array[i]);
+ }
+ return out.toString();
+ }
+}
diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/FakeApi.java
new file mode 100644
index 00000000000..299cc5765af
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/FakeApi.java
@@ -0,0 +1,232 @@
+package io.swagger.client.api;
+
+import io.swagger.client.ApiException;
+import io.swagger.client.ApiClient;
+import io.swagger.client.Configuration;
+import io.swagger.client.Pair;
+
+import javax.ws.rs.core.GenericType;
+
+import io.swagger.client.model.Client;
+import org.joda.time.LocalDate;
+import org.joda.time.DateTime;
+import java.math.BigDecimal;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+
+public class FakeApi {
+ private ApiClient apiClient;
+
+ public FakeApi() {
+ this(Configuration.getDefaultApiClient());
+ }
+
+ public FakeApi(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ public ApiClient getApiClient() {
+ return apiClient;
+ }
+
+ public void setApiClient(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /**
+ * To test \"client\" model
+ *
+ * @param body client model (required)
+ * @return Client
+ * @throws ApiException if fails to make API call
+ */
+ public Client testClientModel(Client body) throws ApiException {
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new ApiException(400, "Missing the required parameter 'body' when calling testClientModel");
+ }
+
+ // create path and map variables
+ String localVarPath = "/fake".replaceAll("\\{format\\}","json");
+
+ // query params
+ List localVarQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+
+
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+
+ final String[] localVarContentTypes = {
+ "application/json"
+ };
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+
+ String[] localVarAuthNames = new String[] { };
+
+ GenericType localVarReturnType = new GenericType() {};
+ return apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
+ }
+ /**
+ * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+ * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+ * @param number None (required)
+ * @param _double None (required)
+ * @param patternWithoutDelimiter None (required)
+ * @param _byte None (required)
+ * @param integer None (optional)
+ * @param int32 None (optional)
+ * @param int64 None (optional)
+ * @param _float None (optional)
+ * @param string None (optional)
+ * @param binary None (optional)
+ * @param date None (optional)
+ * @param dateTime None (optional)
+ * @param password None (optional)
+ * @param paramCallback None (optional)
+ * @throws ApiException if fails to make API call
+ */
+ public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, DateTime dateTime, String password, String paramCallback) throws ApiException {
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'number' is set
+ if (number == null) {
+ throw new ApiException(400, "Missing the required parameter 'number' when calling testEndpointParameters");
+ }
+
+ // verify the required parameter '_double' is set
+ if (_double == null) {
+ throw new ApiException(400, "Missing the required parameter '_double' when calling testEndpointParameters");
+ }
+
+ // verify the required parameter 'patternWithoutDelimiter' is set
+ if (patternWithoutDelimiter == null) {
+ throw new ApiException(400, "Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters");
+ }
+
+ // verify the required parameter '_byte' is set
+ if (_byte == null) {
+ throw new ApiException(400, "Missing the required parameter '_byte' when calling testEndpointParameters");
+ }
+
+ // create path and map variables
+ String localVarPath = "/fake".replaceAll("\\{format\\}","json");
+
+ // query params
+ List localVarQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+
+
+ if (integer != null)
+ localVarFormParams.put("integer", integer);
+if (int32 != null)
+ localVarFormParams.put("int32", int32);
+if (int64 != null)
+ localVarFormParams.put("int64", int64);
+if (number != null)
+ localVarFormParams.put("number", number);
+if (_float != null)
+ localVarFormParams.put("float", _float);
+if (_double != null)
+ localVarFormParams.put("double", _double);
+if (string != null)
+ localVarFormParams.put("string", string);
+if (patternWithoutDelimiter != null)
+ localVarFormParams.put("pattern_without_delimiter", patternWithoutDelimiter);
+if (_byte != null)
+ localVarFormParams.put("byte", _byte);
+if (binary != null)
+ localVarFormParams.put("binary", binary);
+if (date != null)
+ localVarFormParams.put("date", date);
+if (dateTime != null)
+ localVarFormParams.put("dateTime", dateTime);
+if (password != null)
+ localVarFormParams.put("password", password);
+if (paramCallback != null)
+ localVarFormParams.put("callback", paramCallback);
+
+ final String[] localVarAccepts = {
+ "application/xml; charset=utf-8", "application/json; charset=utf-8"
+ };
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+
+ final String[] localVarContentTypes = {
+ "application/xml; charset=utf-8", "application/json; charset=utf-8"
+ };
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+
+ String[] localVarAuthNames = new String[] { "http_basic_test" };
+
+
+ apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
+ }
+ /**
+ * To test enum parameters
+ *
+ * @param enumFormStringArray Form parameter enum test (string array) (optional)
+ * @param enumFormString Form parameter enum test (string) (optional, default to -efg)
+ * @param enumHeaderStringArray Header parameter enum test (string array) (optional)
+ * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg)
+ * @param enumQueryStringArray Query parameter enum test (string array) (optional)
+ * @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)
+ * @throws ApiException if fails to make API call
+ */
+ public void testEnumParameters(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, BigDecimal enumQueryInteger, Double enumQueryDouble) throws ApiException {
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/fake".replaceAll("\\{format\\}","json");
+
+ // query params
+ List localVarQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+ localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "enum_query_string_array", enumQueryStringArray));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_string", enumQueryString));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_integer", enumQueryInteger));
+
+ if (enumHeaderStringArray != null)
+ localVarHeaderParams.put("enum_header_string_array", apiClient.parameterToString(enumHeaderStringArray));
+if (enumHeaderString != null)
+ localVarHeaderParams.put("enum_header_string", apiClient.parameterToString(enumHeaderString));
+
+ if (enumFormStringArray != null)
+ localVarFormParams.put("enum_form_string_array", enumFormStringArray);
+if (enumFormString != null)
+ localVarFormParams.put("enum_form_string", enumFormString);
+if (enumQueryDouble != null)
+ localVarFormParams.put("enum_query_double", enumQueryDouble);
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+
+ final String[] localVarContentTypes = {
+ "application/json"
+ };
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+
+ String[] localVarAuthNames = new String[] { };
+
+
+ apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
+ }
+}
diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/PetApi.java
new file mode 100644
index 00000000000..ab85c4ac394
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/PetApi.java
@@ -0,0 +1,384 @@
+package io.swagger.client.api;
+
+import io.swagger.client.ApiException;
+import io.swagger.client.ApiClient;
+import io.swagger.client.Configuration;
+import io.swagger.client.Pair;
+
+import javax.ws.rs.core.GenericType;
+
+import io.swagger.client.model.Pet;
+import java.io.File;
+import io.swagger.client.model.ModelApiResponse;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+
+public class PetApi {
+ private ApiClient apiClient;
+
+ public PetApi() {
+ this(Configuration.getDefaultApiClient());
+ }
+
+ public PetApi(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ public ApiClient getApiClient() {
+ return apiClient;
+ }
+
+ public void setApiClient(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /**
+ * Add a new pet to the store
+ *
+ * @param body Pet object that needs to be added to the store (required)
+ * @throws ApiException if fails to make API call
+ */
+ public void addPet(Pet body) throws ApiException {
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new ApiException(400, "Missing the required parameter 'body' when calling addPet");
+ }
+
+ // create path and map variables
+ String localVarPath = "/pet".replaceAll("\\{format\\}","json");
+
+ // query params
+ List localVarQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+
+
+
+ final String[] localVarAccepts = {
+ "application/xml", "application/json"
+ };
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+
+ final String[] localVarContentTypes = {
+ "application/json", "application/xml"
+ };
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+
+ String[] localVarAuthNames = new String[] { "petstore_auth" };
+
+
+ apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
+ }
+ /**
+ * Deletes a pet
+ *
+ * @param petId Pet id to delete (required)
+ * @param apiKey (optional)
+ * @throws ApiException if fails to make API call
+ */
+ public void deletePet(Long petId, String apiKey) throws ApiException {
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'petId' is set
+ if (petId == null) {
+ throw new ApiException(400, "Missing the required parameter 'petId' when calling deletePet");
+ }
+
+ // create path and map variables
+ String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json")
+ .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
+
+ // query params
+ List localVarQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+
+ if (apiKey != null)
+ localVarHeaderParams.put("api_key", apiClient.parameterToString(apiKey));
+
+
+ final String[] localVarAccepts = {
+ "application/xml", "application/json"
+ };
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+
+ final String[] localVarContentTypes = {
+
+ };
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+
+ String[] localVarAuthNames = new String[] { "petstore_auth" };
+
+
+ apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
+ }
+ /**
+ * Finds Pets by status
+ * Multiple status values can be provided with comma separated strings
+ * @param status Status values that need to be considered for filter (required)
+ * @return List
+ * @throws ApiException if fails to make API call
+ */
+ public List findPetsByStatus(List status) throws ApiException {
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'status' is set
+ if (status == null) {
+ throw new ApiException(400, "Missing the required parameter 'status' when calling findPetsByStatus");
+ }
+
+ // create path and map variables
+ String localVarPath = "/pet/findByStatus".replaceAll("\\{format\\}","json");
+
+ // query params
+ List localVarQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+ localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "status", status));
+
+
+
+ final String[] localVarAccepts = {
+ "application/xml", "application/json"
+ };
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+
+ final String[] localVarContentTypes = {
+
+ };
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+
+ String[] localVarAuthNames = new String[] { "petstore_auth" };
+
+ GenericType> localVarReturnType = new GenericType>() {};
+ return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
+ }
+ /**
+ * Finds Pets by tags
+ * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+ * @param tags Tags to filter by (required)
+ * @return List
+ * @throws ApiException if fails to make API call
+ */
+ public List findPetsByTags(List tags) throws ApiException {
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'tags' is set
+ if (tags == null) {
+ throw new ApiException(400, "Missing the required parameter 'tags' when calling findPetsByTags");
+ }
+
+ // create path and map variables
+ String localVarPath = "/pet/findByTags".replaceAll("\\{format\\}","json");
+
+ // query params
+ List localVarQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+ localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "tags", tags));
+
+
+
+ final String[] localVarAccepts = {
+ "application/xml", "application/json"
+ };
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+
+ final String[] localVarContentTypes = {
+
+ };
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+
+ String[] localVarAuthNames = new String[] { "petstore_auth" };
+
+ GenericType> localVarReturnType = new GenericType>() {};
+ return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
+ }
+ /**
+ * Find pet by ID
+ * Returns a single pet
+ * @param petId ID of pet to return (required)
+ * @return Pet
+ * @throws ApiException if fails to make API call
+ */
+ public Pet getPetById(Long petId) throws ApiException {
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'petId' is set
+ if (petId == null) {
+ throw new ApiException(400, "Missing the required parameter 'petId' when calling getPetById");
+ }
+
+ // create path and map variables
+ String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json")
+ .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
+
+ // query params
+ List localVarQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+
+
+
+ final String[] localVarAccepts = {
+ "application/xml", "application/json"
+ };
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+
+ final String[] localVarContentTypes = {
+
+ };
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+
+ String[] localVarAuthNames = new String[] { "api_key" };
+
+ GenericType localVarReturnType = new GenericType() {};
+ return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
+ }
+ /**
+ * Update an existing pet
+ *
+ * @param body Pet object that needs to be added to the store (required)
+ * @throws ApiException if fails to make API call
+ */
+ public void updatePet(Pet body) throws ApiException {
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new ApiException(400, "Missing the required parameter 'body' when calling updatePet");
+ }
+
+ // create path and map variables
+ String localVarPath = "/pet".replaceAll("\\{format\\}","json");
+
+ // query params
+ List localVarQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+
+
+
+ final String[] localVarAccepts = {
+ "application/xml", "application/json"
+ };
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+
+ final String[] localVarContentTypes = {
+ "application/json", "application/xml"
+ };
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+
+ String[] localVarAuthNames = new String[] { "petstore_auth" };
+
+
+ apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
+ }
+ /**
+ * Updates a pet in the store with form data
+ *
+ * @param petId ID of pet that needs to be updated (required)
+ * @param name Updated name of the pet (optional)
+ * @param status Updated status of the pet (optional)
+ * @throws ApiException if fails to make API call
+ */
+ public void updatePetWithForm(Long petId, String name, String status) throws ApiException {
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'petId' is set
+ if (petId == null) {
+ throw new ApiException(400, "Missing the required parameter 'petId' when calling updatePetWithForm");
+ }
+
+ // create path and map variables
+ String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json")
+ .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
+
+ // query params
+ List localVarQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+
+
+ if (name != null)
+ localVarFormParams.put("name", name);
+if (status != null)
+ localVarFormParams.put("status", status);
+
+ final String[] localVarAccepts = {
+ "application/xml", "application/json"
+ };
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+
+ final String[] localVarContentTypes = {
+ "application/x-www-form-urlencoded"
+ };
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+
+ String[] localVarAuthNames = new String[] { "petstore_auth" };
+
+
+ apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
+ }
+ /**
+ * uploads an image
+ *
+ * @param petId ID of pet to update (required)
+ * @param additionalMetadata Additional data to pass to server (optional)
+ * @param file file to upload (optional)
+ * @return ModelApiResponse
+ * @throws ApiException if fails to make API call
+ */
+ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File file) throws ApiException {
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'petId' is set
+ if (petId == null) {
+ throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFile");
+ }
+
+ // create path and map variables
+ String localVarPath = "/pet/{petId}/uploadImage".replaceAll("\\{format\\}","json")
+ .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
+
+ // query params
+ List localVarQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+
+
+ if (additionalMetadata != null)
+ localVarFormParams.put("additionalMetadata", additionalMetadata);
+if (file != null)
+ localVarFormParams.put("file", file);
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+
+ final String[] localVarContentTypes = {
+ "multipart/form-data"
+ };
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+
+ String[] localVarAuthNames = new String[] { "petstore_auth" };
+
+ GenericType localVarReturnType = new GenericType() {};
+ return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
+ }
+}
diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/StoreApi.java
new file mode 100644
index 00000000000..c0c9a166ad7
--- /dev/null
+++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/StoreApi.java
@@ -0,0 +1,196 @@
+package io.swagger.client.api;
+
+import io.swagger.client.ApiException;
+import io.swagger.client.ApiClient;
+import io.swagger.client.Configuration;
+import io.swagger.client.Pair;
+
+import javax.ws.rs.core.GenericType;
+
+import io.swagger.client.model.Order;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+
+public class StoreApi {
+ private ApiClient apiClient;
+
+ public StoreApi() {
+ this(Configuration.getDefaultApiClient());
+ }
+
+ public StoreApi(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ public ApiClient getApiClient() {
+ return apiClient;
+ }
+
+ public void setApiClient(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /**
+ * Delete purchase order by ID
+ * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
+ * @param orderId ID of the order that needs to be deleted (required)
+ * @throws ApiException if fails to make API call
+ */
+ public void deleteOrder(String orderId) throws ApiException {
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'orderId' is set
+ if (orderId == null) {
+ throw new ApiException(400, "Missing the required parameter 'orderId' when calling deleteOrder");
+ }
+
+ // create path and map variables
+ String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json")
+ .replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString()));
+
+ // query params
+ List localVarQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+
+
+
+ final String[] localVarAccepts = {
+ "application/xml", "application/json"
+ };
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+
+ final String[] localVarContentTypes = {
+
+ };
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+
+ String[] localVarAuthNames = new String[] { };
+
+
+ apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
+ }
+ /**
+ * Returns pet inventories by status
+ * Returns a map of status codes to quantities
+ * @return Map
+ * @throws ApiException if fails to make API call
+ */
+ public Map getInventory() throws ApiException {
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/store/inventory".replaceAll("\\{format\\}","json");
+
+ // query params
+ List localVarQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+
+
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+
+ final String[] localVarContentTypes = {
+
+ };
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+
+ String[] localVarAuthNames = new String[] { "api_key" };
+
+ GenericType