forked from loafle/openapi-generator-original
Update java play framework samples OAS2 (#286)
* Regenerate play framework examples * Add 'samples.ci' for manual files and update scripts
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
# Swagger Codegen Ignore
|
||||
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
|
||||
# OpenAPI Generator Ignore
|
||||
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
||||
|
||||
# Use this file to prevent files from being overwritten by the generator.
|
||||
# The patterns follow closely to .gitignore or .dockerignore.
|
||||
|
||||
# As an example, the C# client generator defines ApiClient.cs.
|
||||
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
|
||||
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
|
||||
#ApiClient.cs
|
||||
|
||||
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
||||
|
||||
@@ -1 +1 @@
|
||||
2.4.0-SNAPSHOT
|
||||
3.0.0-SNAPSHOT
|
||||
@@ -10,6 +10,6 @@ public class ApiDocController extends Controller {
|
||||
}
|
||||
|
||||
public Result api() {
|
||||
return redirect("/assets/lib/swagger-ui/index.html?/url=/assets/swagger.json");
|
||||
return redirect("/assets/lib/swagger-ui/index.html?/url=/assets/openapi.json");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,17 +40,17 @@ public class PetApiController extends Controller {
|
||||
|
||||
@ApiAction
|
||||
public Result addPet() throws IOException {
|
||||
JsonNode nodebody = request().body().asJson();
|
||||
Pet body;
|
||||
if (nodebody != null) {
|
||||
body = mapper.readValue(nodebody.toString(), Pet.class);
|
||||
JsonNode nodepet = request().body().asJson();
|
||||
Pet pet;
|
||||
if (nodepet != null) {
|
||||
pet = mapper.readValue(nodepet.toString(), Pet.class);
|
||||
if (configuration.getBoolean("useInputBeanValidation")) {
|
||||
SwaggerUtils.validate(body);
|
||||
SwaggerUtils.validate(pet);
|
||||
}
|
||||
} else {
|
||||
throw new IllegalArgumentException("'body' parameter is required");
|
||||
throw new IllegalArgumentException("'Pet' parameter is required");
|
||||
}
|
||||
imp.addPet(body);
|
||||
imp.addPet(pet);
|
||||
return ok();
|
||||
}
|
||||
|
||||
@@ -127,17 +127,17 @@ public class PetApiController extends Controller {
|
||||
|
||||
@ApiAction
|
||||
public Result updatePet() throws IOException {
|
||||
JsonNode nodebody = request().body().asJson();
|
||||
Pet body;
|
||||
if (nodebody != null) {
|
||||
body = mapper.readValue(nodebody.toString(), Pet.class);
|
||||
JsonNode nodepet = request().body().asJson();
|
||||
Pet pet;
|
||||
if (nodepet != null) {
|
||||
pet = mapper.readValue(nodepet.toString(), Pet.class);
|
||||
if (configuration.getBoolean("useInputBeanValidation")) {
|
||||
SwaggerUtils.validate(body);
|
||||
SwaggerUtils.validate(pet);
|
||||
}
|
||||
} else {
|
||||
throw new IllegalArgumentException("'body' parameter is required");
|
||||
throw new IllegalArgumentException("'Pet' parameter is required");
|
||||
}
|
||||
imp.updatePet(body);
|
||||
imp.updatePet(pet);
|
||||
return ok();
|
||||
}
|
||||
|
||||
@@ -148,14 +148,14 @@ public class PetApiController extends Controller {
|
||||
if (valuename != null) {
|
||||
name = valuename;
|
||||
} else {
|
||||
name = null;
|
||||
name = "null";
|
||||
}
|
||||
String valuestatus = (request().body().asMultipartFormData().asFormUrlEncoded().get("status"))[0];
|
||||
String status;
|
||||
if (valuestatus != null) {
|
||||
status = valuestatus;
|
||||
} else {
|
||||
status = null;
|
||||
status = "null";
|
||||
}
|
||||
imp.updatePetWithForm(petId, name, status);
|
||||
return ok();
|
||||
@@ -168,7 +168,7 @@ public class PetApiController extends Controller {
|
||||
if (valueadditionalMetadata != null) {
|
||||
additionalMetadata = valueadditionalMetadata;
|
||||
} else {
|
||||
additionalMetadata = null;
|
||||
additionalMetadata = "null";
|
||||
}
|
||||
Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file");
|
||||
ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file);
|
||||
|
||||
@@ -13,7 +13,7 @@ import javax.validation.constraints.*;
|
||||
|
||||
public class PetApiControllerImp implements PetApiControllerImpInterface {
|
||||
@Override
|
||||
public void addPet(Pet body) {
|
||||
public void addPet(Pet pet) {
|
||||
//Do your magic!!!
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public class PetApiControllerImp implements PetApiControllerImpInterface {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatePet(Pet body) {
|
||||
public void updatePet(Pet pet) {
|
||||
//Do your magic!!!
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import javax.validation.constraints.*;
|
||||
|
||||
@SuppressWarnings("RedundantThrows")
|
||||
public interface PetApiControllerImpInterface {
|
||||
void addPet(Pet body) ;
|
||||
void addPet(Pet pet) ;
|
||||
|
||||
void deletePet(Long petId, String apiKey) ;
|
||||
|
||||
@@ -23,7 +23,7 @@ public interface PetApiControllerImpInterface {
|
||||
|
||||
Pet getPetById(Long petId) ;
|
||||
|
||||
void updatePet(Pet body) ;
|
||||
void updatePet(Pet pet) ;
|
||||
|
||||
void updatePetWithForm(Long petId, String name, String status) ;
|
||||
|
||||
|
||||
@@ -62,17 +62,17 @@ public class StoreApiController extends Controller {
|
||||
|
||||
@ApiAction
|
||||
public Result placeOrder() throws IOException {
|
||||
JsonNode nodebody = request().body().asJson();
|
||||
Order body;
|
||||
if (nodebody != null) {
|
||||
body = mapper.readValue(nodebody.toString(), Order.class);
|
||||
JsonNode nodeorder = request().body().asJson();
|
||||
Order order;
|
||||
if (nodeorder != null) {
|
||||
order = mapper.readValue(nodeorder.toString(), Order.class);
|
||||
if (configuration.getBoolean("useInputBeanValidation")) {
|
||||
SwaggerUtils.validate(body);
|
||||
SwaggerUtils.validate(order);
|
||||
}
|
||||
} else {
|
||||
throw new IllegalArgumentException("'body' parameter is required");
|
||||
throw new IllegalArgumentException("'Order' parameter is required");
|
||||
}
|
||||
Order obj = imp.placeOrder(body);
|
||||
Order obj = imp.placeOrder(order);
|
||||
if (configuration.getBoolean("useOutputBeanValidation")) {
|
||||
SwaggerUtils.validate(obj);
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public class StoreApiControllerImp implements StoreApiControllerImpInterface {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Order placeOrder(Order body) {
|
||||
public Order placeOrder(Order order) {
|
||||
//Do your magic!!!
|
||||
return new Order();
|
||||
}
|
||||
|
||||
@@ -18,6 +18,6 @@ public interface StoreApiControllerImpInterface {
|
||||
|
||||
Order getOrderById( @Min(1) @Max(5)Long orderId) ;
|
||||
|
||||
Order placeOrder(Order body) ;
|
||||
Order placeOrder(Order order) ;
|
||||
|
||||
}
|
||||
|
||||
@@ -39,53 +39,53 @@ public class UserApiController extends Controller {
|
||||
|
||||
@ApiAction
|
||||
public Result createUser() throws IOException {
|
||||
JsonNode nodebody = request().body().asJson();
|
||||
User body;
|
||||
if (nodebody != null) {
|
||||
body = mapper.readValue(nodebody.toString(), User.class);
|
||||
JsonNode nodeuser = request().body().asJson();
|
||||
User user;
|
||||
if (nodeuser != null) {
|
||||
user = mapper.readValue(nodeuser.toString(), User.class);
|
||||
if (configuration.getBoolean("useInputBeanValidation")) {
|
||||
SwaggerUtils.validate(body);
|
||||
SwaggerUtils.validate(user);
|
||||
}
|
||||
} else {
|
||||
throw new IllegalArgumentException("'body' parameter is required");
|
||||
throw new IllegalArgumentException("'User' parameter is required");
|
||||
}
|
||||
imp.createUser(body);
|
||||
imp.createUser(user);
|
||||
return ok();
|
||||
}
|
||||
|
||||
@ApiAction
|
||||
public Result createUsersWithArrayInput() throws IOException {
|
||||
JsonNode nodebody = request().body().asJson();
|
||||
List<User> body;
|
||||
if (nodebody != null) {
|
||||
body = mapper.readValue(nodebody.toString(), new TypeReference<List<User>>(){});
|
||||
JsonNode nodeuser = request().body().asJson();
|
||||
List<User> user;
|
||||
if (nodeuser != null) {
|
||||
user = mapper.readValue(nodeuser.toString(), new TypeReference<List<User>>(){});
|
||||
if (configuration.getBoolean("useInputBeanValidation")) {
|
||||
for (User curItem : body) {
|
||||
for (User curItem : user) {
|
||||
SwaggerUtils.validate(curItem);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
throw new IllegalArgumentException("'body' parameter is required");
|
||||
throw new IllegalArgumentException("'User' parameter is required");
|
||||
}
|
||||
imp.createUsersWithArrayInput(body);
|
||||
imp.createUsersWithArrayInput(user);
|
||||
return ok();
|
||||
}
|
||||
|
||||
@ApiAction
|
||||
public Result createUsersWithListInput() throws IOException {
|
||||
JsonNode nodebody = request().body().asJson();
|
||||
List<User> body;
|
||||
if (nodebody != null) {
|
||||
body = mapper.readValue(nodebody.toString(), new TypeReference<List<User>>(){});
|
||||
JsonNode nodeuser = request().body().asJson();
|
||||
List<User> user;
|
||||
if (nodeuser != null) {
|
||||
user = mapper.readValue(nodeuser.toString(), new TypeReference<List<User>>(){});
|
||||
if (configuration.getBoolean("useInputBeanValidation")) {
|
||||
for (User curItem : body) {
|
||||
for (User curItem : user) {
|
||||
SwaggerUtils.validate(curItem);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
throw new IllegalArgumentException("'body' parameter is required");
|
||||
throw new IllegalArgumentException("'User' parameter is required");
|
||||
}
|
||||
imp.createUsersWithListInput(body);
|
||||
imp.createUsersWithListInput(user);
|
||||
return ok();
|
||||
}
|
||||
|
||||
@@ -134,17 +134,17 @@ public class UserApiController extends Controller {
|
||||
|
||||
@ApiAction
|
||||
public Result updateUser(String username) throws IOException {
|
||||
JsonNode nodebody = request().body().asJson();
|
||||
User body;
|
||||
if (nodebody != null) {
|
||||
body = mapper.readValue(nodebody.toString(), User.class);
|
||||
JsonNode nodeuser = request().body().asJson();
|
||||
User user;
|
||||
if (nodeuser != null) {
|
||||
user = mapper.readValue(nodeuser.toString(), User.class);
|
||||
if (configuration.getBoolean("useInputBeanValidation")) {
|
||||
SwaggerUtils.validate(body);
|
||||
SwaggerUtils.validate(user);
|
||||
}
|
||||
} else {
|
||||
throw new IllegalArgumentException("'body' parameter is required");
|
||||
throw new IllegalArgumentException("'User' parameter is required");
|
||||
}
|
||||
imp.updateUser(username, body);
|
||||
imp.updateUser(username, user);
|
||||
return ok();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,17 +12,17 @@ import javax.validation.constraints.*;
|
||||
|
||||
public class UserApiControllerImp implements UserApiControllerImpInterface {
|
||||
@Override
|
||||
public void createUser(User body) {
|
||||
public void createUser(User user) {
|
||||
//Do your magic!!!
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createUsersWithArrayInput(List<User> body) {
|
||||
public void createUsersWithArrayInput(List<User> user) {
|
||||
//Do your magic!!!
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createUsersWithListInput(List<User> body) {
|
||||
public void createUsersWithListInput(List<User> user) {
|
||||
//Do your magic!!!
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public class UserApiControllerImp implements UserApiControllerImpInterface {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateUser(String username, User body) {
|
||||
public void updateUser(String username, User user) {
|
||||
//Do your magic!!!
|
||||
}
|
||||
|
||||
|
||||
@@ -12,11 +12,11 @@ import javax.validation.constraints.*;
|
||||
|
||||
@SuppressWarnings("RedundantThrows")
|
||||
public interface UserApiControllerImpInterface {
|
||||
void createUser(User body) ;
|
||||
void createUser(User user) ;
|
||||
|
||||
void createUsersWithArrayInput(List<User> body) ;
|
||||
void createUsersWithArrayInput(List<User> user) ;
|
||||
|
||||
void createUsersWithListInput(List<User> body) ;
|
||||
void createUsersWithListInput(List<User> user) ;
|
||||
|
||||
void deleteUser(String username) ;
|
||||
|
||||
@@ -26,6 +26,6 @@ public interface UserApiControllerImpInterface {
|
||||
|
||||
void logoutUser() ;
|
||||
|
||||
void updateUser(String username, User body) ;
|
||||
void updateUser(String username, User user) ;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
name := """swagger-java-playframework"""
|
||||
name := """openapi-java-playframework"""
|
||||
|
||||
version := "1.0-SNAPSHOT"
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user