forked from loafle/openapi-generator-original
Merge remote-tracking branch 'origin/master' into 2.3.0
This commit is contained in:
@@ -133,6 +133,7 @@ public class ApiClient {
|
||||
objectMapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING);
|
||||
objectMapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING);
|
||||
objectMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
|
||||
objectMapper.disable(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE);
|
||||
objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
|
||||
objectMapper.setDateFormat(new RFC3339DateFormat());
|
||||
ThreeTenModule module = new ThreeTenModule();
|
||||
|
||||
@@ -7,6 +7,7 @@ import java.math.BigDecimal;
|
||||
import io.swagger.client.model.Client;
|
||||
import org.threeten.bp.LocalDate;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import io.swagger.client.model.OuterComposite;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -18,6 +19,58 @@ import feign.*;
|
||||
public interface FakeApi extends ApiClient.Api {
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Test serialization of outer boolean types
|
||||
* @param body Input boolean as post body (optional)
|
||||
* @return Boolean
|
||||
*/
|
||||
@RequestLine("POST /fake/outer/boolean")
|
||||
@Headers({
|
||||
"Content-Type: application/json",
|
||||
"Accept: application/json",
|
||||
})
|
||||
Boolean fakeOuterBooleanSerialize(Boolean body);
|
||||
|
||||
/**
|
||||
*
|
||||
* Test serialization of object with outer number type
|
||||
* @param body Input composite as post body (optional)
|
||||
* @return OuterComposite
|
||||
*/
|
||||
@RequestLine("POST /fake/outer/composite")
|
||||
@Headers({
|
||||
"Content-Type: application/json",
|
||||
"Accept: application/json",
|
||||
})
|
||||
OuterComposite fakeOuterCompositeSerialize(OuterComposite body);
|
||||
|
||||
/**
|
||||
*
|
||||
* Test serialization of outer number types
|
||||
* @param body Input number as post body (optional)
|
||||
* @return BigDecimal
|
||||
*/
|
||||
@RequestLine("POST /fake/outer/number")
|
||||
@Headers({
|
||||
"Content-Type: application/json",
|
||||
"Accept: application/json",
|
||||
})
|
||||
BigDecimal fakeOuterNumberSerialize(BigDecimal body);
|
||||
|
||||
/**
|
||||
*
|
||||
* Test serialization of outer string types
|
||||
* @param body Input string as post body (optional)
|
||||
* @return String
|
||||
*/
|
||||
@RequestLine("POST /fake/outer/string")
|
||||
@Headers({
|
||||
"Content-Type: application/json",
|
||||
"Accept: application/json",
|
||||
})
|
||||
String fakeOuterStringSerialize(String body);
|
||||
|
||||
/**
|
||||
* To test \"client\" model
|
||||
* To test \"client\" model
|
||||
|
||||
@@ -0,0 +1,137 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
|
||||
package io.swagger.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* OuterComposite
|
||||
*/
|
||||
|
||||
public class OuterComposite {
|
||||
@JsonProperty("my_number")
|
||||
private BigDecimal myNumber = null;
|
||||
|
||||
@JsonProperty("my_string")
|
||||
private String myString = null;
|
||||
|
||||
@JsonProperty("my_boolean")
|
||||
private Boolean myBoolean = null;
|
||||
|
||||
public OuterComposite myNumber(BigDecimal myNumber) {
|
||||
this.myNumber = myNumber;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get myNumber
|
||||
* @return myNumber
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public BigDecimal getMyNumber() {
|
||||
return myNumber;
|
||||
}
|
||||
|
||||
public void setMyNumber(BigDecimal myNumber) {
|
||||
this.myNumber = myNumber;
|
||||
}
|
||||
|
||||
public OuterComposite myString(String myString) {
|
||||
this.myString = myString;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get myString
|
||||
* @return myString
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public String getMyString() {
|
||||
return myString;
|
||||
}
|
||||
|
||||
public void setMyString(String myString) {
|
||||
this.myString = myString;
|
||||
}
|
||||
|
||||
public OuterComposite myBoolean(Boolean myBoolean) {
|
||||
this.myBoolean = myBoolean;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get myBoolean
|
||||
* @return myBoolean
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public Boolean getMyBoolean() {
|
||||
return myBoolean;
|
||||
}
|
||||
|
||||
public void setMyBoolean(Boolean myBoolean) {
|
||||
this.myBoolean = myBoolean;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
OuterComposite outerComposite = (OuterComposite) o;
|
||||
return Objects.equals(this.myNumber, outerComposite.myNumber) &&
|
||||
Objects.equals(this.myString, outerComposite.myString) &&
|
||||
Objects.equals(this.myBoolean, outerComposite.myBoolean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(myNumber, myString, myBoolean);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class OuterComposite {\n");
|
||||
|
||||
sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n");
|
||||
sb.append(" myString: ").append(toIndentedString(myString)).append("\n");
|
||||
sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package io.swagger.client.api;
|
||||
|
||||
import io.swagger.client.ApiClient;
|
||||
import io.swagger.client.model.Client;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import org.threeten.bp.LocalDate;
|
||||
import java.math.BigDecimal;
|
||||
import io.swagger.client.model.Client;
|
||||
import org.threeten.bp.LocalDate;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import io.swagger.client.model.OuterComposite;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -26,10 +27,66 @@ public class FakeApiTest {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* Test serialization of outer boolean types
|
||||
*/
|
||||
@Test
|
||||
public void fakeOuterBooleanSerializeTest() {
|
||||
Boolean body = null;
|
||||
// Boolean response = api.fakeOuterBooleanSerialize(body);
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* Test serialization of object with outer number type
|
||||
*/
|
||||
@Test
|
||||
public void fakeOuterCompositeSerializeTest() {
|
||||
OuterComposite body = null;
|
||||
// OuterComposite response = api.fakeOuterCompositeSerialize(body);
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* Test serialization of outer number types
|
||||
*/
|
||||
@Test
|
||||
public void fakeOuterNumberSerializeTest() {
|
||||
BigDecimal body = null;
|
||||
// BigDecimal response = api.fakeOuterNumberSerialize(body);
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* Test serialization of outer string types
|
||||
*/
|
||||
@Test
|
||||
public void fakeOuterStringSerializeTest() {
|
||||
String body = null;
|
||||
// String response = api.fakeOuterStringSerialize(body);
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* To test \"client\" model
|
||||
*
|
||||
*
|
||||
* To test \"client\" model
|
||||
*/
|
||||
@Test
|
||||
public void testClientModelTest() {
|
||||
@@ -38,6 +95,7 @@ public class FakeApiTest {
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
@@ -64,11 +122,12 @@ public class FakeApiTest {
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* To test enum parameters
|
||||
*
|
||||
*
|
||||
* To test enum parameters
|
||||
*/
|
||||
@Test
|
||||
public void testEnumParametersTest() {
|
||||
@@ -78,11 +137,35 @@ public class FakeApiTest {
|
||||
String enumHeaderString = null;
|
||||
List<String> enumQueryStringArray = null;
|
||||
String enumQueryString = null;
|
||||
BigDecimal enumQueryInteger = null;
|
||||
Integer enumQueryInteger = null;
|
||||
Double enumQueryDouble = null;
|
||||
// api.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble);
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
|
||||
/**
|
||||
* To test enum parameters
|
||||
*
|
||||
* To test enum parameters
|
||||
*
|
||||
* This tests the overload of the method that uses a Map for query parameters instead of
|
||||
* listing them out individually.
|
||||
*/
|
||||
@Test
|
||||
public void testEnumParametersTestQueryMap() {
|
||||
List<String> enumFormStringArray = null;
|
||||
String enumFormString = null;
|
||||
List<String> enumHeaderStringArray = null;
|
||||
String enumHeaderString = null;
|
||||
Double enumQueryDouble = null;
|
||||
FakeApi.TestEnumParametersQueryParams queryParams = new FakeApi.TestEnumParametersQueryParams()
|
||||
.enumQueryStringArray(null)
|
||||
.enumQueryString(null)
|
||||
.enumQueryInteger(null);
|
||||
// api.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryDouble, queryParams);
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user