issue-890 correct fix for deprecated Jersey method

additionally
- fixed EnumValueTest to the directory structure based on the declared package
- regenerated samples/client/java/jersey1
This commit is contained in:
Oliver Vidovic
2016-10-11 11:43:54 -04:00
parent 504f8f1f21
commit da6e829c8e
34 changed files with 65 additions and 61 deletions

View File

@@ -609,7 +609,7 @@ public class ApiClient {
statusCode = response.getStatusInfo().getStatusCode();
responseHeaders = response.getHeaders();
if(response.getStatusInfo() == ClientResponse.Status.NO_CONTENT) {
if(response.getStatusInfo().getStatusCode() == ClientResponse.Status.NO_CONTENT.getStatusCode()) {
return null;
} else if (response.getStatusInfo().getFamily() == Family.SUCCESSFUL) {
if (returnType == null)

View File

@@ -54,7 +54,7 @@ No authorization required
<a name="testEndpointParameters"></a>
# **testEndpointParameters**
> testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password)
> testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback)
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
@@ -90,8 +90,9 @@ byte[] binary = B; // byte[] | None
LocalDate date = new LocalDate(); // LocalDate | None
DateTime dateTime = new DateTime(); // DateTime | None
String password = "password_example"; // String | None
String paramCallback = "paramCallback_example"; // String | None
try {
apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password);
apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback);
} catch (ApiException e) {
System.err.println("Exception when calling FakeApi#testEndpointParameters");
e.printStackTrace();
@@ -115,6 +116,7 @@ Name | Type | Description | Notes
**date** | **LocalDate**| None | [optional]
**dateTime** | **DateTime**| None | [optional]
**password** | **String**| None | [optional]
**paramCallback** | **String**| None | [optional]
### Return type

View File

@@ -622,7 +622,7 @@ public class ApiClient {
statusCode = response.getStatusInfo().getStatusCode();
responseHeaders = response.getHeaders();
if(response.getStatusInfo() == ClientResponse.Status.NO_CONTENT) {
if(response.getStatusInfo().getStatusCode() == ClientResponse.Status.NO_CONTENT.getStatusCode()) {
return null;
} else if (response.getStatusInfo().getFamily() == Family.SUCCESSFUL) {
if (returnType == null)

View File

@@ -1,4 +1,4 @@
/**
/*
* 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: \" \\
*

View File

@@ -120,9 +120,10 @@ public class FakeApi {
* @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) throws ApiException {
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
@@ -181,6 +182,8 @@ 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"

View File

@@ -34,12 +34,11 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* AdditionalPropertiesClass
*/
public class AdditionalPropertiesClass {
public class AdditionalPropertiesClass {
@JsonProperty("map_property")
private Map<String, String> mapProperty = new HashMap<String, String>();
@@ -132,5 +131,6 @@ public class AdditionalPropertiesClass {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -31,12 +31,11 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* Animal
*/
public class Animal {
public class Animal {
@JsonProperty("className")
private String className = null;
@@ -119,5 +118,6 @@ public class Animal {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -30,12 +30,11 @@ import io.swagger.client.model.Animal;
import java.util.ArrayList;
import java.util.List;
/**
* AnimalFarm
*/
public class AnimalFarm extends ArrayList<Animal> {
public class AnimalFarm extends ArrayList<Animal> {
@Override
public boolean equals(java.lang.Object o) {
@@ -72,5 +71,6 @@ public class AnimalFarm extends ArrayList<Animal> {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -34,12 +34,11 @@ import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
/**
* ArrayOfArrayOfNumberOnly
*/
public class ArrayOfArrayOfNumberOnly {
public class ArrayOfArrayOfNumberOnly {
@JsonProperty("ArrayArrayNumber")
private List<List<BigDecimal>> arrayArrayNumber = new ArrayList<List<BigDecimal>>();
@@ -104,5 +103,6 @@ public class ArrayOfArrayOfNumberOnly {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -34,12 +34,11 @@ import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
/**
* ArrayOfNumberOnly
*/
public class ArrayOfNumberOnly {
public class ArrayOfNumberOnly {
@JsonProperty("ArrayNumber")
private List<BigDecimal> arrayNumber = new ArrayList<BigDecimal>();
@@ -104,5 +103,6 @@ public class ArrayOfNumberOnly {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -34,12 +34,11 @@ import io.swagger.client.model.ReadOnlyFirst;
import java.util.ArrayList;
import java.util.List;
/**
* ArrayTest
*/
public class ArrayTest {
public class ArrayTest {
@JsonProperty("array_of_string")
private List<String> arrayOfString = new ArrayList<String>();
@@ -160,5 +159,6 @@ public class ArrayTest {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -32,12 +32,11 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.client.model.Animal;
/**
* Cat
*/
public class Cat extends Animal {
public class Cat extends Animal {
@JsonProperty("declawed")
private Boolean declawed = null;
@@ -98,5 +97,6 @@ public class Cat extends Animal {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -31,12 +31,11 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* Category
*/
public class Category {
public class Category {
@JsonProperty("id")
private Long id = null;
@@ -119,5 +118,6 @@ public class Category {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -31,12 +31,11 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* Client
*/
public class Client {
public class Client {
@JsonProperty("client")
private String client = null;
@@ -96,5 +95,6 @@ public class Client {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -32,12 +32,11 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.client.model.Animal;
/**
* Dog
*/
public class Dog extends Animal {
public class Dog extends Animal {
@JsonProperty("breed")
private String breed = null;
@@ -98,5 +97,6 @@ public class Dog extends Animal {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -33,12 +33,11 @@ import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.List;
/**
* EnumArrays
*/
public class EnumArrays {
public class EnumArrays {
/**
* Gets or Sets justSymbol
*/
@@ -186,5 +185,6 @@ public class EnumArrays {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -27,7 +27,6 @@ package io.swagger.client.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonCreator;
/**

View File

@@ -31,12 +31,11 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* EnumTest
*/
public class EnumTest {
public class EnumTest {
/**
* Gets or Sets enumString
*/
@@ -232,5 +231,6 @@ public class EnumTest {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -34,12 +34,11 @@ import java.math.BigDecimal;
import org.joda.time.DateTime;
import org.joda.time.LocalDate;
/**
* FormatTest
*/
public class FormatTest {
public class FormatTest {
@JsonProperty("integer")
private Integer integer = null;
@@ -385,5 +384,6 @@ public class FormatTest {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -31,12 +31,11 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* HasOnlyReadOnly
*/
public class HasOnlyReadOnly {
public class HasOnlyReadOnly {
@JsonProperty("bar")
private String bar = null;
@@ -101,5 +100,6 @@ public class HasOnlyReadOnly {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -34,12 +34,11 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* MapTest
*/
public class MapTest {
public class MapTest {
@JsonProperty("map_map_of_string")
private Map<String, Map<String, String>> mapMapOfString = new HashMap<String, Map<String, String>>();
@@ -162,5 +161,6 @@ public class MapTest {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -36,12 +36,11 @@ import java.util.List;
import java.util.Map;
import org.joda.time.DateTime;
/**
* MixedPropertiesAndAdditionalPropertiesClass
*/
public class MixedPropertiesAndAdditionalPropertiesClass {
public class MixedPropertiesAndAdditionalPropertiesClass {
@JsonProperty("uuid")
private String uuid = null;
@@ -152,5 +151,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -31,13 +31,12 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* Model for testing model name starting with number
*/
@ApiModel(description = "Model for testing model name starting with number")
public class Model200Response {
public class Model200Response {
@JsonProperty("name")
private Integer name = null;
@@ -120,5 +119,6 @@ public class Model200Response {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -31,12 +31,11 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* ModelApiResponse
*/
public class ModelApiResponse {
public class ModelApiResponse {
@JsonProperty("code")
private Integer code = null;
@@ -142,5 +141,6 @@ public class ModelApiResponse {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -31,13 +31,12 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* Model for testing reserved words
*/
@ApiModel(description = "Model for testing reserved words")
public class ModelReturn {
public class ModelReturn {
@JsonProperty("return")
private Integer _return = null;
@@ -97,5 +96,6 @@ public class ModelReturn {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -31,13 +31,12 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* Model for testing model name same as property name
*/
@ApiModel(description = "Model for testing model name same as property name")
public class Name {
public class Name {
@JsonProperty("name")
private Integer name = null;
@@ -148,5 +147,6 @@ public class Name {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -32,12 +32,11 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
/**
* NumberOnly
*/
public class NumberOnly {
public class NumberOnly {
@JsonProperty("JustNumber")
private BigDecimal justNumber = null;
@@ -97,5 +96,6 @@ public class NumberOnly {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -32,12 +32,11 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.joda.time.DateTime;
/**
* Order
*/
public class Order {
public class Order {
@JsonProperty("id")
private Long id = null;
@@ -244,5 +243,6 @@ public class Order {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -35,12 +35,11 @@ import io.swagger.client.model.Tag;
import java.util.ArrayList;
import java.util.List;
/**
* Pet
*/
public class Pet {
public class Pet {
@JsonProperty("id")
private Long id = null;
@@ -257,5 +256,6 @@ public class Pet {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -31,12 +31,11 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* ReadOnlyFirst
*/
public class ReadOnlyFirst {
public class ReadOnlyFirst {
@JsonProperty("bar")
private String bar = null;
@@ -110,5 +109,6 @@ public class ReadOnlyFirst {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -31,12 +31,11 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* SpecialModelName
*/
public class SpecialModelName {
public class SpecialModelName {
@JsonProperty("$special[property.name]")
private Long specialPropertyName = null;
@@ -96,5 +95,6 @@ public class SpecialModelName {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -31,12 +31,11 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* Tag
*/
public class Tag {
public class Tag {
@JsonProperty("id")
private Long id = null;
@@ -119,5 +118,6 @@ public class Tag {
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -31,12 +31,11 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* User
*/
public class User {
public class User {
@JsonProperty("id")
private Long id = null;
@@ -257,5 +256,6 @@ public class User {
}
return o.toString().replace("\n", "\n ");
}
}