Fix the fake endpoint example. Now all cases are handled by the java play framework! (#6850)

This commit is contained in:
Jean-François Côté
2017-11-02 05:54:34 -04:00
committed by wing328
parent e7594c42d0
commit 16373b9f70
34 changed files with 54 additions and 129 deletions

View File

@@ -159,7 +159,7 @@ public class FakeApiController extends Controller {
String valuenumber = (request().body().asMultipartFormData().asFormUrlEncoded().get("number"))[0];
BigDecimal number;
if (valuenumber != null) {
number = Float.parseFloat(valuenumber);
number = new BigDecimal(valuenumber);
} else {
throw new IllegalArgumentException("'number' parameter is required");
}
@@ -194,7 +194,7 @@ public class FakeApiController extends Controller {
String value_byte = (request().body().asMultipartFormData().asFormUrlEncoded().get("byte"))[0];
byte[] _byte;
if (value_byte != null) {
_byte = value_byte;
_byte = value_byte.getBytes();
} else {
throw new IllegalArgumentException("'byte' parameter is required");
}

View File

@@ -17,7 +17,7 @@ public class FakeApiControllerImp implements FakeApiControllerImpInterface {
@Override
public Boolean fakeOuterBooleanSerialize(Boolean body) throws Exception {
//Do your magic!!!
return new Boolean();
return new Boolean(true);
}
@Override
@@ -29,7 +29,7 @@ public class FakeApiControllerImp implements FakeApiControllerImpInterface {
@Override
public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws Exception {
//Do your magic!!!
return new BigDecimal();
return new BigDecimal(1.0);
}
@Override
@@ -47,25 +47,21 @@ public class FakeApiControllerImp implements FakeApiControllerImpInterface {
@Override
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, OffsetDateTime dateTime, String password, String paramCallback) throws Exception {
//Do your magic!!!
}
@Override
public void testEnumParameters(List<String> enumFormStringArray, String enumFormString, List<String> enumHeaderStringArray, String enumHeaderString, List<String> enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble) throws Exception {
//Do your magic!!!
}
@Override
public void testInlineAdditionalProperties(Object param) throws Exception {
//Do your magic!!!
}
@Override
public void testJsonFormData(String param, String param2) throws Exception {
//Do your magic!!!
}
}

View File

@@ -15,13 +15,11 @@ public class PetApiControllerImp implements PetApiControllerImpInterface {
@Override
public void addPet(Pet body) throws Exception {
//Do your magic!!!
}
@Override
public void deletePet(Long petId, String apiKey) throws Exception {
//Do your magic!!!
}
@Override
@@ -45,13 +43,11 @@ public class PetApiControllerImp implements PetApiControllerImpInterface {
@Override
public void updatePet(Pet body) throws Exception {
//Do your magic!!!
}
@Override
public void updatePetWithForm(Long petId, String name, String status) throws Exception {
//Do your magic!!!
}
@Override

View File

@@ -14,7 +14,6 @@ public class StoreApiControllerImp implements StoreApiControllerImpInterface {
@Override
public void deleteOrder(String orderId) throws Exception {
//Do your magic!!!
}
@Override

View File

@@ -14,25 +14,21 @@ public class UserApiControllerImp implements UserApiControllerImpInterface {
@Override
public void createUser(User body) throws Exception {
//Do your magic!!!
}
@Override
public void createUsersWithArrayInput(List<User> body) throws Exception {
//Do your magic!!!
}
@Override
public void createUsersWithListInput(List<User> body) throws Exception {
//Do your magic!!!
}
@Override
public void deleteUser(String username) throws Exception {
//Do your magic!!!
}
@Override
@@ -50,13 +46,11 @@ public class UserApiControllerImp implements UserApiControllerImpInterface {
@Override
public void logoutUser() throws Exception {
//Do your magic!!!
}
@Override
public void updateUser(String username, User body) throws Exception {
//Do your magic!!!
}
}

View File

@@ -978,7 +978,8 @@
}
},
"x-contentType" : "application/json",
"x-accepts" : "application/json"
"x-accepts" : "application/json",
"missingReturnInfoIfNeeded" : "1.0"
}
},
"/fake/outer/string" : {
@@ -1030,7 +1031,8 @@
}
},
"x-contentType" : "application/json",
"x-accepts" : "application/json"
"x-accepts" : "application/json",
"missingReturnInfoIfNeeded" : "true"
}
},
"/fake/outer/composite" : {