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:
Jérémie Bresson
2018-05-03 08:19:59 +02:00
committed by GitHub
parent 9cf185912c
commit 0ba2a9a250
155 changed files with 6808 additions and 5263 deletions

View File

@@ -30,3 +30,5 @@ export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/
ags="$@ generate -t modules/openapi-generator/src/main/resources/JavaPlayFramework -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -l java-play-framework -o samples/server/petstore/java-play-framework-api-package-override -DhideGenerationTimestamp=true,apiPackage=com.puppies.store.apis"
java $JAVA_OPTS -jar $executable $ags
cp samples.ci/server/petstore/java-play-framework-api-package-override/pom.xml samples/server/petstore/java-play-framework-api-package-override/pom.xml

View File

@@ -30,3 +30,5 @@ export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/
ags="$@ generate -t modules/openapi-generator/src/main/resources/JavaPlayFramework -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -l java-play-framework -o samples/server/petstore/java-play-framework-controller-only -DhideGenerationTimestamp=true,controllerOnly=true"
java $JAVA_OPTS -jar $executable $ags
cp samples.ci/server/petstore/java-play-framework-controller-only/pom.xml samples/server/petstore/java-play-framework-controller-only/pom.xml

View File

@@ -30,3 +30,5 @@ export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/
ags="$@ generate -t modules/openapi-generator/src/main/resources/JavaPlayFramework -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l java-play-framework -o samples/server/petstore/java-play-framework-fake-endpoints -DhideGenerationTimestamp=true"
java $JAVA_OPTS -jar $executable $ags
cp samples.ci/server/petstore/java-play-framework-fake-endpoints/pom.xml samples/server/petstore/java-play-framework-fake-endpoints/pom.xml

View File

@@ -30,3 +30,5 @@ export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/
ags="$@ generate -t modules/openapi-generator/src/main/resources/JavaPlayFramework -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -l java-play-framework -o samples/server/petstore/java-play-framework-no-bean-validation -DhideGenerationTimestamp=true,useBeanValidation=false"
java $JAVA_OPTS -jar $executable $ags
cp samples.ci/server/petstore/java-play-framework-no-bean-validation/pom.xml samples/server/petstore/java-play-framework-no-bean-validation/pom.xml

View File

@@ -30,3 +30,5 @@ export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/
ags="$@ generate -t modules/openapi-generator/src/main/resources/JavaPlayFramework -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -l java-play-framework -o samples/server/petstore/java-play-framework-no-exception-handling -DhideGenerationTimestamp=true,handleExceptions=false"
java $JAVA_OPTS -jar $executable $ags
cp samples.ci/server/petstore/java-play-framework-no-exception-handling/pom.xml samples/server/petstore/java-play-framework-no-exception-handling/pom.xml

View File

@@ -30,3 +30,5 @@ export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/
ags="$@ generate -t modules/openapi-generator/src/main/resources/JavaPlayFramework -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -l java-play-framework -o samples/server/petstore/java-play-framework-no-interface -DhideGenerationTimestamp=true,useInterfaces=false"
java $JAVA_OPTS -jar $executable $ags
cp samples.ci/server/petstore/java-play-framework-no-interface/pom.xml samples/server/petstore/java-play-framework-no-interface/pom.xml

View File

@@ -30,3 +30,5 @@ export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/
ags="$@ generate -t modules/openapi-generator/src/main/resources/JavaPlayFramework -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -l java-play-framework -o samples/server/petstore/java-play-framework-no-swagger-ui -DhideGenerationTimestamp=true,useSwaggerUI=false"
java $JAVA_OPTS -jar $executable $ags
cp samples.ci/server/petstore/java-play-framework-no-swagger-ui/pom.xml samples/server/petstore/java-play-framework-no-swagger-ui/pom.xml

View File

@@ -30,3 +30,5 @@ export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/
ags="$@ generate -t modules/openapi-generator/src/main/resources/JavaPlayFramework -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -l java-play-framework -o samples/server/petstore/java-play-framework-no-wrap-calls -DhideGenerationTimestamp=true,wrapCalls=false"
java $JAVA_OPTS -jar $executable $ags
cp samples.ci/server/petstore/java-play-framework-no-wrap-calls/pom.xml samples/server/petstore/java-play-framework-no-wrap-calls/pom.xml

View File

@@ -30,3 +30,5 @@ export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/
ags="generate -t modules/openapi-generator/src/main/resources/JavaPlayFramework -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -l java-play-framework -o samples/server/petstore/java-play-framework -DhideGenerationTimestamp=true $@"
java $JAVA_OPTS -jar $executable $ags
cp samples.ci/server/petstore/java-play-framework/pom.xml samples/server/petstore/java-play-framework/pom.xml

View File

@@ -0,0 +1,46 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>io.swagger</groupId>
<artifactId>PlayServerTests-api-package-override</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<name>Play Petstore Server</name>
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>Play Test</id>
<phase>integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>sbt</executable>
<arguments>
<argument>test</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -0,0 +1,46 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>io.swagger</groupId>
<artifactId>PlayServerTests-controller-only</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<name>Play Petstore Server</name>
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>Play Test</id>
<phase>integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>sbt</executable>
<arguments>
<argument>test</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -0,0 +1,46 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>io.swagger</groupId>
<artifactId>PlayServerTests-fake-endpoints</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<name>Play Petstore Server</name>
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>Play Test</id>
<phase>integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>sbt</executable>
<arguments>
<argument>test</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -0,0 +1,46 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>io.swagger</groupId>
<artifactId>PlayServerTests-no-bean-validation</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<name>Play Petstore Server</name>
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>Play Test</id>
<phase>integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>sbt</executable>
<arguments>
<argument>test</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -0,0 +1,46 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>io.swagger</groupId>
<artifactId>PlayServerTests-no-exception-handling</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<name>Play Petstore Server</name>
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>Play Test</id>
<phase>integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>sbt</executable>
<arguments>
<argument>test</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -0,0 +1,46 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>io.swagger</groupId>
<artifactId>PlayServerTests-no-interface</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<name>Play Petstore Server</name>
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>Play Test</id>
<phase>integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>sbt</executable>
<arguments>
<argument>test</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -0,0 +1,46 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>io.swagger</groupId>
<artifactId>PlayServerTests-no-swagger-ui</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<name>Play Petstore Server</name>
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>Play Test</id>
<phase>integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>sbt</executable>
<arguments>
<argument>test</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -0,0 +1,46 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>io.swagger</groupId>
<artifactId>PlayServerTests-no-wrap-calls</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<name>Play Petstore Server</name>
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>Play Test</id>
<phase>integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>sbt</executable>
<arguments>
<argument>test</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -0,0 +1,46 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>io.swagger</groupId>
<artifactId>PlayServerTests</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<name>Play Petstore Server</name>
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>Play Test</id>
<phase>integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>sbt</executable>
<arguments>
<argument>test</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -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 (*):

View File

@@ -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");
}
}

View File

@@ -39,17 +39,17 @@ public class PetApiController extends Controller {
@ApiAction
public Result addPet() throws Exception {
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();
}
@@ -126,17 +126,17 @@ public class PetApiController extends Controller {
@ApiAction
public Result updatePet() throws Exception {
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();
}
@@ -147,14 +147,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();
@@ -167,7 +167,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);

View File

@@ -13,7 +13,7 @@ import javax.validation.constraints.*;
public class PetApiControllerImp implements PetApiControllerImpInterface {
@Override
public void addPet(Pet body) throws Exception {
public void addPet(Pet pet) throws Exception {
//Do your magic!!!
}
@@ -41,7 +41,7 @@ public class PetApiControllerImp implements PetApiControllerImpInterface {
}
@Override
public void updatePet(Pet body) throws Exception {
public void updatePet(Pet pet) throws Exception {
//Do your magic!!!
}

View File

@@ -13,7 +13,7 @@ import javax.validation.constraints.*;
@SuppressWarnings("RedundantThrows")
public interface PetApiControllerImpInterface {
void addPet(Pet body) throws Exception;
void addPet(Pet pet) throws Exception;
void deletePet(Long petId, String apiKey) throws Exception;
@@ -23,7 +23,7 @@ public interface PetApiControllerImpInterface {
Pet getPetById(Long petId) throws Exception;
void updatePet(Pet body) throws Exception;
void updatePet(Pet pet) throws Exception;
void updatePetWithForm(Long petId, String name, String status) throws Exception;

View File

@@ -61,17 +61,17 @@ public class StoreApiController extends Controller {
@ApiAction
public Result placeOrder() throws Exception {
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);
}

View File

@@ -29,7 +29,7 @@ public class StoreApiControllerImp implements StoreApiControllerImpInterface {
}
@Override
public Order placeOrder(Order body) throws Exception {
public Order placeOrder(Order order) throws Exception {
//Do your magic!!!
return new Order();
}

View File

@@ -18,6 +18,6 @@ public interface StoreApiControllerImpInterface {
Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception;
Order placeOrder(Order body) throws Exception;
Order placeOrder(Order order) throws Exception;
}

View File

@@ -38,53 +38,53 @@ public class UserApiController extends Controller {
@ApiAction
public Result createUser() throws Exception {
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 Exception {
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 Exception {
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();
}
@@ -133,17 +133,17 @@ public class UserApiController extends Controller {
@ApiAction
public Result updateUser(String username) throws Exception {
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();
}
}

View File

@@ -12,17 +12,17 @@ import javax.validation.constraints.*;
public class UserApiControllerImp implements UserApiControllerImpInterface {
@Override
public void createUser(User body) throws Exception {
public void createUser(User user) throws Exception {
//Do your magic!!!
}
@Override
public void createUsersWithArrayInput(List<User> body) throws Exception {
public void createUsersWithArrayInput(List<User> user) throws Exception {
//Do your magic!!!
}
@Override
public void createUsersWithListInput(List<User> body) throws Exception {
public void createUsersWithListInput(List<User> user) throws Exception {
//Do your magic!!!
}
@@ -49,7 +49,7 @@ public class UserApiControllerImp implements UserApiControllerImpInterface {
}
@Override
public void updateUser(String username, User body) throws Exception {
public void updateUser(String username, User user) throws Exception {
//Do your magic!!!
}

View File

@@ -12,11 +12,11 @@ import javax.validation.constraints.*;
@SuppressWarnings("RedundantThrows")
public interface UserApiControllerImpInterface {
void createUser(User body) throws Exception;
void createUser(User user) throws Exception;
void createUsersWithArrayInput(List<User> body) throws Exception;
void createUsersWithArrayInput(List<User> user) throws Exception;
void createUsersWithListInput(List<User> body) throws Exception;
void createUsersWithListInput(List<User> user) throws Exception;
void deleteUser(String username) throws Exception;
@@ -26,6 +26,6 @@ public interface UserApiControllerImpInterface {
void logoutUser() throws Exception;
void updateUser(String username, User body) throws Exception;
void updateUser(String username, User user) throws Exception;
}

View File

@@ -1,4 +1,4 @@
name := """swagger-java-playframework"""
name := """openapi-java-playframework"""
version := "1.0-SNAPSHOT"

View File

@@ -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 (*):

View File

@@ -1 +1 @@
2.4.0-SNAPSHOT
3.0.0-SNAPSHOT

View File

@@ -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");
}
}

View File

@@ -42,18 +42,18 @@ public class PetApiController extends Controller {
@ApiAction
public CompletionStage<Result> addPet() throws Exception {
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");
}
return CompletableFuture.supplyAsync(() -> {
imp.addPet(body)
imp.addPet(pet)
return ok();
});
}
@@ -145,18 +145,18 @@ public class PetApiController extends Controller {
@ApiAction
public CompletionStage<Result> updatePet() throws Exception {
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");
}
return CompletableFuture.supplyAsync(() -> {
imp.updatePet(body)
imp.updatePet(pet)
return ok();
});
}
@@ -168,14 +168,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";
}
return CompletableFuture.supplyAsync(() -> {
imp.updatePetWithForm(petId, name, status)
@@ -190,7 +190,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");
CompletionStage<ModelApiResponse> stage = imp.uploadFile(petId, additionalMetadata, file).thenApply(obj -> {

View File

@@ -13,7 +13,7 @@ import javax.validation.constraints.*;
public class PetApiControllerImp implements PetApiControllerImpInterface {
@Override
public void addPet(Pet body) throws Exception {
public void addPet(Pet pet) throws Exception {
//Do your magic!!!
}
@@ -47,7 +47,7 @@ public class PetApiControllerImp implements PetApiControllerImpInterface {
}
@Override
public void updatePet(Pet body) throws Exception {
public void updatePet(Pet pet) throws Exception {
//Do your magic!!!
}

View File

@@ -15,7 +15,7 @@ import javax.validation.constraints.*;
@SuppressWarnings("RedundantThrows")
public interface PetApiControllerImpInterface {
void addPet(Pet body) throws Exception;
void addPet(Pet pet) throws Exception;
void deletePet(Long petId, String apiKey) throws Exception;
@@ -25,7 +25,7 @@ public interface PetApiControllerImpInterface {
CompletionStage<Pet> getPetById(Long petId) throws Exception;
void updatePet(Pet body) throws Exception;
void updatePet(Pet pet) throws Exception;
void updatePetWithForm(Long petId, String name, String status) throws Exception;

View File

@@ -74,17 +74,17 @@ public class StoreApiController extends Controller {
@ApiAction
public CompletionStage<Result> placeOrder() throws Exception {
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");
}
CompletionStage<Order> stage = imp.placeOrder(body).thenApply(obj -> {
CompletionStage<Order> stage = imp.placeOrder(order).thenApply(obj -> {
if (configuration.getBoolean("useOutputBeanValidation")) {
SwaggerUtils.validate(obj);
}

View File

@@ -33,7 +33,7 @@ public class StoreApiControllerImp implements StoreApiControllerImpInterface {
}
@Override
public CompletionStage<Order> placeOrder(Order body) throws Exception {
public CompletionStage<Order> placeOrder(Order order) throws Exception {
//Do your magic!!!
return CompletableFuture.supplyAsync(() -> {
return new Order();

View File

@@ -20,6 +20,6 @@ public interface StoreApiControllerImpInterface {
CompletionStage<Order> getOrderById( @Min(1) @Max(5)Long orderId) throws Exception;
CompletionStage<Order> placeOrder(Order body) throws Exception;
CompletionStage<Order> placeOrder(Order order) throws Exception;
}

View File

@@ -41,58 +41,58 @@ public class UserApiController extends Controller {
@ApiAction
public CompletionStage<Result> createUser() throws Exception {
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");
}
return CompletableFuture.supplyAsync(() -> {
imp.createUser(body)
imp.createUser(user)
return ok();
});
}
@ApiAction
public CompletionStage<Result> createUsersWithArrayInput() throws Exception {
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");
}
return CompletableFuture.supplyAsync(() -> {
imp.createUsersWithArrayInput(body)
imp.createUsersWithArrayInput(user)
return ok();
});
}
@ApiAction
public CompletionStage<Result> createUsersWithListInput() throws Exception {
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");
}
return CompletableFuture.supplyAsync(() -> {
imp.createUsersWithListInput(body)
imp.createUsersWithListInput(user)
return ok();
});
}
@@ -154,18 +154,18 @@ public class UserApiController extends Controller {
@ApiAction
public CompletionStage<Result> updateUser(String username) throws Exception {
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");
}
return CompletableFuture.supplyAsync(() -> {
imp.updateUser(username, body)
imp.updateUser(username, user)
return ok();
});
}

View File

@@ -12,17 +12,17 @@ import javax.validation.constraints.*;
public class UserApiControllerImp implements UserApiControllerImpInterface {
@Override
public void createUser(User body) throws Exception {
public void createUser(User user) throws Exception {
//Do your magic!!!
}
@Override
public void createUsersWithArrayInput(List<User> body) throws Exception {
public void createUsersWithArrayInput(List<User> user) throws Exception {
//Do your magic!!!
}
@Override
public void createUsersWithListInput(List<User> body) throws Exception {
public void createUsersWithListInput(List<User> user) throws Exception {
//Do your magic!!!
}
@@ -53,7 +53,7 @@ public class UserApiControllerImp implements UserApiControllerImpInterface {
}
@Override
public void updateUser(String username, User body) throws Exception {
public void updateUser(String username, User user) throws Exception {
//Do your magic!!!
}

View File

@@ -14,11 +14,11 @@ import javax.validation.constraints.*;
@SuppressWarnings("RedundantThrows")
public interface UserApiControllerImpInterface {
void createUser(User body) throws Exception;
void createUser(User user) throws Exception;
void createUsersWithArrayInput(List<User> body) throws Exception;
void createUsersWithArrayInput(List<User> user) throws Exception;
void createUsersWithListInput(List<User> body) throws Exception;
void createUsersWithListInput(List<User> user) throws Exception;
void deleteUser(String username) throws Exception;
@@ -28,6 +28,6 @@ public interface UserApiControllerImpInterface {
void logoutUser() throws Exception;
void updateUser(String username, User body) throws Exception;
void updateUser(String username, User user) throws Exception;
}

View File

@@ -1,4 +1,4 @@
name := """swagger-java-playframework"""
name := """openapi-java-playframework"""
version := "1.0-SNAPSHOT"

View File

@@ -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 (*):

View File

@@ -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");
}
}

View File

@@ -37,15 +37,15 @@ public class PetApiController extends Controller {
@ApiAction
public Result addPet() throws Exception {
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");
}
return ok();
}
@@ -103,15 +103,15 @@ public class PetApiController extends Controller {
@ApiAction
public Result updatePet() throws Exception {
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");
}
return ok();
}
@@ -123,14 +123,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";
}
return ok();
}
@@ -142,7 +142,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");
return ok();

View File

@@ -51,15 +51,15 @@ public class StoreApiController extends Controller {
@ApiAction
public Result placeOrder() throws Exception {
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");
}
return ok();
}

View File

@@ -36,49 +36,49 @@ public class UserApiController extends Controller {
@ApiAction
public Result createUser() throws Exception {
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");
}
return ok();
}
@ApiAction
public Result createUsersWithArrayInput() throws Exception {
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");
}
return ok();
}
@ApiAction
public Result createUsersWithListInput() throws Exception {
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");
}
return ok();
}
@@ -119,15 +119,15 @@ public class UserApiController extends Controller {
@ApiAction
public Result updateUser(String username) throws Exception {
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");
}
return ok();
}

View File

@@ -1,4 +1,4 @@
name := """swagger-java-playframework"""
name := """openapi-java-playframework"""
version := "1.0-SNAPSHOT"

View File

@@ -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 (*):

View File

@@ -1 +1 @@
2.4.0-SNAPSHOT
3.0.0-SNAPSHOT

View File

@@ -48,6 +48,42 @@ public class EnumTest {
@JsonProperty("enum_string")
private EnumStringEnum enumString = null;
/**
* Gets or Sets enumStringRequired
*/
public enum EnumStringRequiredEnum {
UPPER("UPPER"),
LOWER("lower"),
EMPTY("");
private final String value;
EnumStringRequiredEnum(String value) {
this.value = value;
}
@Override
@JsonValue
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static EnumStringRequiredEnum fromValue(String text) {
for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
}
@JsonProperty("enum_string_required")
private EnumStringRequiredEnum enumStringRequired = null;
/**
* Gets or Sets enumInteger
*/
@@ -136,6 +172,24 @@ public class EnumTest {
this.enumString = enumString;
}
public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) {
this.enumStringRequired = enumStringRequired;
return this;
}
/**
* Get enumStringRequired
* @return enumStringRequired
**/
@NotNull
public EnumStringRequiredEnum getEnumStringRequired() {
return enumStringRequired;
}
public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) {
this.enumStringRequired = enumStringRequired;
}
public EnumTest enumInteger(EnumIntegerEnum enumInteger) {
this.enumInteger = enumInteger;
return this;
@@ -199,6 +253,7 @@ public class EnumTest {
}
EnumTest enumTest = (EnumTest) o;
return Objects.equals(enumString, enumTest.enumString) &&
Objects.equals(enumStringRequired, enumTest.enumStringRequired) &&
Objects.equals(enumInteger, enumTest.enumInteger) &&
Objects.equals(enumNumber, enumTest.enumNumber) &&
Objects.equals(outerEnum, enumTest.outerEnum);
@@ -206,7 +261,7 @@ public class EnumTest {
@Override
public int hashCode() {
return Objects.hash(enumString, enumInteger, enumNumber, outerEnum);
return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum);
}
@SuppressWarnings("StringBufferReplaceableByString")
@@ -216,6 +271,7 @@ public class EnumTest {
sb.append("class EnumTest {\n");
sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n");
sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).append("\n");
sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n");
sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n");
sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n");

View File

@@ -1,5 +1,6 @@
package apimodels;
import java.io.InputStream;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.OffsetDateTime;
@@ -40,7 +41,7 @@ public class FormatTest {
private byte[] _byte = null;
@JsonProperty("binary")
private byte[] binary = null;
private InputStream binary = null;
@JsonProperty("date")
private LocalDate date = null;
@@ -215,7 +216,7 @@ public class FormatTest {
this._byte = _byte;
}
public FormatTest binary(byte[] binary) {
public FormatTest binary(InputStream binary) {
this.binary = binary;
return this;
}
@@ -224,11 +225,12 @@ public class FormatTest {
* Get binary
* @return binary
**/
public byte[] getBinary() {
@Valid
public InputStream getBinary() {
return binary;
}
public void setBinary(byte[] binary) {
public void setBinary(InputStream binary) {
this.binary = binary;
}

View File

@@ -60,9 +60,9 @@ public class Model200Response {
if (o == null || getClass() != o.getClass()) {
return false;
}
Model200Response _200Response = (Model200Response) o;
return Objects.equals(name, _200Response.name) &&
Objects.equals(propertyClass, _200Response.propertyClass);
Model200Response _200response = (Model200Response) o;
return Objects.equals(name, _200response.name) &&
Objects.equals(propertyClass, _200response.propertyClass);
}
@Override

View File

@@ -21,7 +21,7 @@ public class Name {
private String property = null;
@JsonProperty("123Number")
private Integer _123Number = null;
private Integer _123number = null;
public Name name(Integer name) {
this.name = name;
@@ -75,21 +75,21 @@ public class Name {
this.property = property;
}
public Name _123Number(Integer _123Number) {
this._123Number = _123Number;
public Name _123number(Integer _123number) {
this._123number = _123number;
return this;
}
/**
* Get _123Number
* @return _123Number
* Get _123number
* @return _123number
**/
public Integer get123Number() {
return _123Number;
public Integer get123number() {
return _123number;
}
public void set123Number(Integer _123Number) {
this._123Number = _123Number;
public void set123number(Integer _123number) {
this._123number = _123number;
}
@@ -105,12 +105,12 @@ public class Name {
return Objects.equals(name, name.name) &&
Objects.equals(snakeCase, name.snakeCase) &&
Objects.equals(property, name.property) &&
Objects.equals(_123Number, name._123Number);
Objects.equals(_123number, name._123number);
}
@Override
public int hashCode() {
return Objects.hash(name, snakeCase, property, _123Number);
return Objects.hash(name, snakeCase, property, _123number);
}
@SuppressWarnings("StringBufferReplaceableByString")
@@ -122,7 +122,7 @@ public class Name {
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n");
sb.append(" property: ").append(toIndentedString(property)).append("\n");
sb.append(" _123Number: ").append(toIndentedString(_123Number)).append("\n");
sb.append(" _123number: ").append(toIndentedString(_123number)).append("\n");
sb.append("}");
return sb.toString();
}

View File

@@ -12,23 +12,23 @@ import javax.validation.constraints.*;
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public class SpecialModelName {
@JsonProperty("$special[property.name]")
private Long specialPropertyName = null;
private Long $specialPropertyName = null;
public SpecialModelName specialPropertyName(Long specialPropertyName) {
this.specialPropertyName = specialPropertyName;
public SpecialModelName $specialPropertyName(Long $specialPropertyName) {
this.$specialPropertyName = $specialPropertyName;
return this;
}
/**
* Get specialPropertyName
* @return specialPropertyName
* Get $specialPropertyName
* @return $specialPropertyName
**/
public Long getSpecialPropertyName() {
return specialPropertyName;
public Long get$SpecialPropertyName() {
return $specialPropertyName;
}
public void setSpecialPropertyName(Long specialPropertyName) {
this.specialPropertyName = specialPropertyName;
public void set$SpecialPropertyName(Long $specialPropertyName) {
this.$specialPropertyName = $specialPropertyName;
}
@@ -40,13 +40,13 @@ public class SpecialModelName {
if (o == null || getClass() != o.getClass()) {
return false;
}
SpecialModelName specialModelName = (SpecialModelName) o;
return Objects.equals(specialPropertyName, specialModelName.specialPropertyName);
SpecialModelName $specialModelName = (SpecialModelName) o;
return Objects.equals($specialPropertyName, $specialModelName.$specialPropertyName);
}
@Override
public int hashCode() {
return Objects.hash(specialPropertyName);
return Objects.hash($specialPropertyName);
}
@SuppressWarnings("StringBufferReplaceableByString")
@@ -55,7 +55,7 @@ public class SpecialModelName {
StringBuilder sb = new StringBuilder();
sb.append("class SpecialModelName {\n");
sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).append("\n");
sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n");
sb.append("}");
return sb.toString();
}

View File

@@ -37,17 +37,17 @@ public class AnotherFakeApiController extends Controller {
@ApiAction
public Result testSpecialTags() throws Exception {
JsonNode nodebody = request().body().asJson();
Client body;
if (nodebody != null) {
body = mapper.readValue(nodebody.toString(), Client.class);
JsonNode nodeclient = request().body().asJson();
Client client;
if (nodeclient != null) {
client = mapper.readValue(nodeclient.toString(), Client.class);
if (configuration.getBoolean("useInputBeanValidation")) {
SwaggerUtils.validate(body);
SwaggerUtils.validate(client);
}
} else {
throw new IllegalArgumentException("'body' parameter is required");
throw new IllegalArgumentException("'Client' parameter is required");
}
Client obj = imp.testSpecialTags(body);
Client obj = imp.testSpecialTags(client);
if (configuration.getBoolean("useOutputBeanValidation")) {
SwaggerUtils.validate(obj);
}

View File

@@ -11,7 +11,7 @@ import javax.validation.constraints.*;
public class AnotherFakeApiControllerImp implements AnotherFakeApiControllerImpInterface {
@Override
public Client testSpecialTags(Client body) throws Exception {
public Client testSpecialTags(Client client) throws Exception {
//Do your magic!!!
return new Client();
}

View File

@@ -11,6 +11,6 @@ import javax.validation.constraints.*;
@SuppressWarnings("RedundantThrows")
public interface AnotherFakeApiControllerImpInterface {
Client testSpecialTags(Client body) throws Exception;
Client testSpecialTags(Client client) throws Exception;
}

View File

@@ -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");
}
}

View File

@@ -2,9 +2,12 @@ package controllers;
import java.math.BigDecimal;
import apimodels.Client;
import java.io.InputStream;
import java.time.LocalDate;
import java.util.Map;
import java.time.OffsetDateTime;
import apimodels.OuterComposite;
import apimodels.User;
import play.mvc.Controller;
import play.mvc.Result;
@@ -58,17 +61,17 @@ public class FakeApiController extends Controller {
@ApiAction
public Result fakeOuterCompositeSerialize() throws Exception {
JsonNode nodebody = request().body().asJson();
OuterComposite body;
if (nodebody != null) {
body = mapper.readValue(nodebody.toString(), OuterComposite.class);
JsonNode nodeouterComposite = request().body().asJson();
OuterComposite outerComposite;
if (nodeouterComposite != null) {
outerComposite = mapper.readValue(nodeouterComposite.toString(), OuterComposite.class);
if (configuration.getBoolean("useInputBeanValidation")) {
SwaggerUtils.validate(body);
SwaggerUtils.validate(outerComposite);
}
} else {
body = null;
outerComposite = null;
}
OuterComposite obj = imp.fakeOuterCompositeSerialize(body);
OuterComposite obj = imp.fakeOuterCompositeSerialize(outerComposite);
if (configuration.getBoolean("useOutputBeanValidation")) {
SwaggerUtils.validate(obj);
}
@@ -114,18 +117,41 @@ public class FakeApiController extends Controller {
}
@ApiAction
public Result testClientModel() throws Exception {
JsonNode nodebody = request().body().asJson();
Client body;
if (nodebody != null) {
body = mapper.readValue(nodebody.toString(), Client.class);
public Result testBodyWithQueryParams() throws Exception {
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");
}
Client obj = imp.testClientModel(body);
String valuequery = request().getQueryString("query");
String query;
if (valuequery != null) {
query = valuequery;
} else {
throw new IllegalArgumentException("'query' parameter is required");
}
imp.testBodyWithQueryParams(query, user);
return ok();
}
@ApiAction
public Result testClientModel() throws Exception {
JsonNode nodeclient = request().body().asJson();
Client client;
if (nodeclient != null) {
client = mapper.readValue(nodeclient.toString(), Client.class);
if (configuration.getBoolean("useInputBeanValidation")) {
SwaggerUtils.validate(client);
}
} else {
throw new IllegalArgumentException("'Client' parameter is required");
}
Client obj = imp.testClientModel(client);
if (configuration.getBoolean("useOutputBeanValidation")) {
SwaggerUtils.validate(obj);
}
@@ -182,7 +208,7 @@ public class FakeApiController extends Controller {
if (valuestring != null) {
string = valuestring;
} else {
string = null;
string = "null";
}
String valuepatternWithoutDelimiter = (request().body().asMultipartFormData().asFormUrlEncoded().get("pattern_without_delimiter"))[0];
String patternWithoutDelimiter;
@@ -198,13 +224,7 @@ public class FakeApiController extends Controller {
} else {
throw new IllegalArgumentException("'byte' parameter is required");
}
String valuebinary = (request().body().asMultipartFormData().asFormUrlEncoded().get("binary"))[0];
byte[] binary;
if (valuebinary != null) {
binary = valuebinary.getBytes();
} else {
binary = null;
}
Http.MultipartFormData.FilePart binary = request().body().asMultipartFormData().getFile("binary");
String valuedate = (request().body().asMultipartFormData().asFormUrlEncoded().get("date"))[0];
LocalDate date;
if (valuedate != null) {
@@ -224,14 +244,14 @@ public class FakeApiController extends Controller {
if (valuepassword != null) {
password = valuepassword;
} else {
password = null;
password = "null";
}
String valueparamCallback = (request().body().asMultipartFormData().asFormUrlEncoded().get("callback"))[0];
String paramCallback;
if (valueparamCallback != null) {
paramCallback = valueparamCallback;
} else {
paramCallback = null;
paramCallback = "null";
}
imp.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback);
return ok();
@@ -262,14 +282,19 @@ public class FakeApiController extends Controller {
} else {
enumQueryInteger = null;
}
String[] enumFormStringArrayArray = request().body().asMultipartFormData().asFormUrlEncoded().get("enum_form_string_array");
List<String> enumFormStringArrayList = SwaggerUtils.parametersToList("csv", enumFormStringArrayArray);
List<String> enumFormStringArray = new ArrayList<String>();
for (String curParam : enumFormStringArrayList) {
if (!curParam.isEmpty()) {
//noinspection UseBulkOperation
enumFormStringArray.add(curParam);
String valueenumQueryDouble = request().getQueryString("enum_query_double");
Double enumQueryDouble;
if (valueenumQueryDouble != null) {
enumQueryDouble = Double.parseDouble(valueenumQueryDouble);
} else {
enumQueryDouble = null;
}
String valueenumFormStringArray = (request().body().asMultipartFormData().asFormUrlEncoded().get("enum_form_string_array"))[0];
List<String> enumFormStringArray;
if (valueenumFormStringArray != null) {
enumFormStringArray = valueenumFormStringArray;
} else {
enumFormStringArray = new ArrayList<>();
}
String valueenumFormString = (request().body().asMultipartFormData().asFormUrlEncoded().get("enum_form_string"))[0];
String enumFormString;
@@ -278,13 +303,6 @@ public class FakeApiController extends Controller {
} else {
enumFormString = "-efg";
}
String valueenumQueryDouble = (request().body().asMultipartFormData().asFormUrlEncoded().get("enum_query_double"))[0];
Double enumQueryDouble;
if (valueenumQueryDouble != null) {
enumQueryDouble = Double.parseDouble(valueenumQueryDouble);
} else {
enumQueryDouble = null;
}
String[] enumHeaderStringArrayArray = request().headers().get("enum_header_string_array");
List<String> enumHeaderStringArrayList = SwaggerUtils.parametersToList("csv", enumHeaderStringArrayArray);
List<String> enumHeaderStringArray = new ArrayList<String>();
@@ -301,23 +319,25 @@ public class FakeApiController extends Controller {
} else {
enumHeaderString = "-efg";
}
imp.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble);
imp.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString);
return ok();
}
@ApiAction
public Result testInlineAdditionalProperties() throws Exception {
JsonNode nodeparam = request().body().asJson();
Object param;
if (nodeparam != null) {
param = mapper.readValue(nodeparam.toString(), Object.class);
JsonNode noderequestBody = request().body().asJson();
String requestBody;
if (noderequestBody != null) {
requestBody = mapper.readValue(noderequestBody.toString(), new TypeReference<String>(){});
if (configuration.getBoolean("useInputBeanValidation")) {
SwaggerUtils.validate(param);
for (Map.Entry<String, String> entry : requestBody.entrySet()) {
SwaggerUtils.validate(entry.getValue());
}
}
} else {
throw new IllegalArgumentException("'param' parameter is required");
throw new IllegalArgumentException("'request_body' parameter is required");
}
imp.testInlineAdditionalProperties(param);
imp.testInlineAdditionalProperties(requestBody);
return ok();
}

View File

@@ -2,9 +2,12 @@ package controllers;
import java.math.BigDecimal;
import apimodels.Client;
import java.io.InputStream;
import java.time.LocalDate;
import java.util.Map;
import java.time.OffsetDateTime;
import apimodels.OuterComposite;
import apimodels.User;
import play.mvc.Http;
import java.util.List;
@@ -21,7 +24,7 @@ public class FakeApiControllerImp implements FakeApiControllerImpInterface {
}
@Override
public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws Exception {
public OuterComposite fakeOuterCompositeSerialize(OuterComposite outerComposite) throws Exception {
//Do your magic!!!
return new OuterComposite();
}
@@ -39,23 +42,28 @@ public class FakeApiControllerImp implements FakeApiControllerImpInterface {
}
@Override
public Client testClientModel(Client body) throws Exception {
public void testBodyWithQueryParams( @NotNull String query, User user) throws Exception {
//Do your magic!!!
}
@Override
public Client testClientModel(Client client) throws Exception {
//Do your magic!!!
return new Client();
}
@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 {
public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, Http.MultipartFormData.FilePart 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 {
public void testEnumParameters(List<String> enumHeaderStringArray, String enumHeaderString, List<String> enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List<String> enumFormStringArray, String enumFormString) throws Exception {
//Do your magic!!!
}
@Override
public void testInlineAdditionalProperties(Object param) throws Exception {
public void testInlineAdditionalProperties(String requestBody) throws Exception {
//Do your magic!!!
}

View File

@@ -2,9 +2,12 @@ package controllers;
import java.math.BigDecimal;
import apimodels.Client;
import java.io.InputStream;
import java.time.LocalDate;
import java.util.Map;
import java.time.OffsetDateTime;
import apimodels.OuterComposite;
import apimodels.User;
import play.mvc.Http;
import java.util.List;
@@ -17,19 +20,21 @@ import javax.validation.constraints.*;
public interface FakeApiControllerImpInterface {
Boolean fakeOuterBooleanSerialize(Boolean body) throws Exception;
OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws Exception;
OuterComposite fakeOuterCompositeSerialize(OuterComposite outerComposite) throws Exception;
BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws Exception;
String fakeOuterStringSerialize(String body) throws Exception;
Client testClientModel(Client body) throws Exception;
void testBodyWithQueryParams( @NotNull String query, User user) throws Exception;
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;
Client testClientModel(Client client) throws Exception;
void testEnumParameters(List<String> enumFormStringArray, String enumFormString, List<String> enumHeaderStringArray, String enumHeaderString, List<String> enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble) throws Exception;
void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, Http.MultipartFormData.FilePart binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws Exception;
void testInlineAdditionalProperties(Object param) throws Exception;
void testEnumParameters(List<String> enumHeaderStringArray, String enumHeaderString, List<String> enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List<String> enumFormStringArray, String enumFormString) throws Exception;
void testInlineAdditionalProperties(String requestBody) throws Exception;
void testJsonFormData(String param, String param2) throws Exception;

View File

@@ -37,17 +37,17 @@ public class FakeClassnameTags123ApiController extends Controller {
@ApiAction
public Result testClassname() throws Exception {
JsonNode nodebody = request().body().asJson();
Client body;
if (nodebody != null) {
body = mapper.readValue(nodebody.toString(), Client.class);
JsonNode nodeclient = request().body().asJson();
Client client;
if (nodeclient != null) {
client = mapper.readValue(nodeclient.toString(), Client.class);
if (configuration.getBoolean("useInputBeanValidation")) {
SwaggerUtils.validate(body);
SwaggerUtils.validate(client);
}
} else {
throw new IllegalArgumentException("'body' parameter is required");
throw new IllegalArgumentException("'Client' parameter is required");
}
Client obj = imp.testClassname(body);
Client obj = imp.testClassname(client);
if (configuration.getBoolean("useOutputBeanValidation")) {
SwaggerUtils.validate(obj);
}

View File

@@ -11,7 +11,7 @@ import javax.validation.constraints.*;
public class FakeClassnameTags123ApiControllerImp implements FakeClassnameTags123ApiControllerImpInterface {
@Override
public Client testClassname(Client body) throws Exception {
public Client testClassname(Client client) throws Exception {
//Do your magic!!!
return new Client();
}

View File

@@ -11,6 +11,6 @@ import javax.validation.constraints.*;
@SuppressWarnings("RedundantThrows")
public interface FakeClassnameTags123ApiControllerImpInterface {
Client testClassname(Client body) throws Exception;
Client testClassname(Client client) throws Exception;
}

View File

@@ -39,17 +39,17 @@ public class PetApiController extends Controller {
@ApiAction
public Result addPet() throws Exception {
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();
}
@@ -126,17 +126,17 @@ public class PetApiController extends Controller {
@ApiAction
public Result updatePet() throws Exception {
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();
}
@@ -147,14 +147,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();
@@ -167,7 +167,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);

View File

@@ -13,7 +13,7 @@ import javax.validation.constraints.*;
public class PetApiControllerImp implements PetApiControllerImpInterface {
@Override
public void addPet(Pet body) throws Exception {
public void addPet(Pet pet) throws Exception {
//Do your magic!!!
}
@@ -41,7 +41,7 @@ public class PetApiControllerImp implements PetApiControllerImpInterface {
}
@Override
public void updatePet(Pet body) throws Exception {
public void updatePet(Pet pet) throws Exception {
//Do your magic!!!
}

View File

@@ -13,7 +13,7 @@ import javax.validation.constraints.*;
@SuppressWarnings("RedundantThrows")
public interface PetApiControllerImpInterface {
void addPet(Pet body) throws Exception;
void addPet(Pet pet) throws Exception;
void deletePet(Long petId, String apiKey) throws Exception;
@@ -23,7 +23,7 @@ public interface PetApiControllerImpInterface {
Pet getPetById(Long petId) throws Exception;
void updatePet(Pet body) throws Exception;
void updatePet(Pet pet) throws Exception;
void updatePetWithForm(Long petId, String name, String status) throws Exception;

View File

@@ -61,17 +61,17 @@ public class StoreApiController extends Controller {
@ApiAction
public Result placeOrder() throws Exception {
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);
}

View File

@@ -29,7 +29,7 @@ public class StoreApiControllerImp implements StoreApiControllerImpInterface {
}
@Override
public Order placeOrder(Order body) throws Exception {
public Order placeOrder(Order order) throws Exception {
//Do your magic!!!
return new Order();
}

View File

@@ -18,6 +18,6 @@ public interface StoreApiControllerImpInterface {
Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception;
Order placeOrder(Order body) throws Exception;
Order placeOrder(Order order) throws Exception;
}

View File

@@ -38,53 +38,53 @@ public class UserApiController extends Controller {
@ApiAction
public Result createUser() throws Exception {
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 Exception {
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 Exception {
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();
}
@@ -133,17 +133,17 @@ public class UserApiController extends Controller {
@ApiAction
public Result updateUser(String username) throws Exception {
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();
}
}

View File

@@ -12,17 +12,17 @@ import javax.validation.constraints.*;
public class UserApiControllerImp implements UserApiControllerImpInterface {
@Override
public void createUser(User body) throws Exception {
public void createUser(User user) throws Exception {
//Do your magic!!!
}
@Override
public void createUsersWithArrayInput(List<User> body) throws Exception {
public void createUsersWithArrayInput(List<User> user) throws Exception {
//Do your magic!!!
}
@Override
public void createUsersWithListInput(List<User> body) throws Exception {
public void createUsersWithListInput(List<User> user) throws Exception {
//Do your magic!!!
}
@@ -49,7 +49,7 @@ public class UserApiControllerImp implements UserApiControllerImpInterface {
}
@Override
public void updateUser(String username, User body) throws Exception {
public void updateUser(String username, User user) throws Exception {
//Do your magic!!!
}

View File

@@ -12,11 +12,11 @@ import javax.validation.constraints.*;
@SuppressWarnings("RedundantThrows")
public interface UserApiControllerImpInterface {
void createUser(User body) throws Exception;
void createUser(User user) throws Exception;
void createUsersWithArrayInput(List<User> body) throws Exception;
void createUsersWithArrayInput(List<User> user) throws Exception;
void createUsersWithListInput(List<User> body) throws Exception;
void createUsersWithListInput(List<User> user) throws Exception;
void deleteUser(String username) throws Exception;
@@ -26,6 +26,6 @@ public interface UserApiControllerImpInterface {
void logoutUser() throws Exception;
void updateUser(String username, User body) throws Exception;
void updateUser(String username, User user) throws Exception;
}

View File

@@ -1,4 +1,4 @@
name := """swagger-java-playframework"""
name := """openapi-java-playframework"""
version := "1.0-SNAPSHOT"

View File

@@ -13,6 +13,7 @@ POST /v2/fake/outer/boolean controllers.FakeApiControlle
POST /v2/fake/outer/composite controllers.FakeApiController.fakeOuterCompositeSerialize()
POST /v2/fake/outer/number controllers.FakeApiController.fakeOuterNumberSerialize()
POST /v2/fake/outer/string controllers.FakeApiController.fakeOuterStringSerialize()
PUT /v2/fake/body-with-query-params controllers.FakeApiController.testBodyWithQueryParams()
PATCH /v2/fake controllers.FakeApiController.testClientModel()
POST /v2/fake controllers.FakeApiController.testEndpointParameters()
GET /v2/fake controllers.FakeApiController.testEnumParameters()

View File

@@ -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 (*):

View File

@@ -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");
}
}

View File

@@ -35,14 +35,14 @@ public class PetApiController extends Controller {
@ApiAction
public Result addPet() throws Exception {
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);
} else {
throw new IllegalArgumentException("'body' parameter is required");
throw new IllegalArgumentException("'Pet' parameter is required");
}
imp.addPet(body);
imp.addPet(pet);
return ok();
}
@@ -106,14 +106,14 @@ public class PetApiController extends Controller {
@ApiAction
public Result updatePet() throws Exception {
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);
} else {
throw new IllegalArgumentException("'body' parameter is required");
throw new IllegalArgumentException("'Pet' parameter is required");
}
imp.updatePet(body);
imp.updatePet(pet);
return ok();
}
@@ -124,14 +124,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();
@@ -144,7 +144,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);

View File

@@ -12,7 +12,7 @@ import java.io.FileInputStream;
public class PetApiControllerImp implements PetApiControllerImpInterface {
@Override
public void addPet(Pet body) throws Exception {
public void addPet(Pet pet) throws Exception {
//Do your magic!!!
}
@@ -40,7 +40,7 @@ public class PetApiControllerImp implements PetApiControllerImpInterface {
}
@Override
public void updatePet(Pet body) throws Exception {
public void updatePet(Pet pet) throws Exception {
//Do your magic!!!
}

View File

@@ -12,7 +12,7 @@ import java.util.HashMap;
@SuppressWarnings("RedundantThrows")
public interface PetApiControllerImpInterface {
void addPet(Pet body) throws Exception;
void addPet(Pet pet) throws Exception;
void deletePet(Long petId, String apiKey) throws Exception;
@@ -22,7 +22,7 @@ public interface PetApiControllerImpInterface {
Pet getPetById(Long petId) throws Exception;
void updatePet(Pet body) throws Exception;
void updatePet(Pet pet) throws Exception;
void updatePetWithForm(Long petId, String name, String status) throws Exception;

View File

@@ -54,14 +54,14 @@ public class StoreApiController extends Controller {
@ApiAction
public Result placeOrder() throws Exception {
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);
} 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);
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}

View File

@@ -28,7 +28,7 @@ public class StoreApiControllerImp implements StoreApiControllerImpInterface {
}
@Override
public Order placeOrder(Order body) throws Exception {
public Order placeOrder(Order order) throws Exception {
//Do your magic!!!
return new Order();
}

View File

@@ -17,6 +17,6 @@ public interface StoreApiControllerImpInterface {
Order getOrderById(Long orderId) throws Exception;
Order placeOrder(Order body) throws Exception;
Order placeOrder(Order order) throws Exception;
}

View File

@@ -34,40 +34,40 @@ public class UserApiController extends Controller {
@ApiAction
public Result createUser() throws Exception {
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);
} 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 Exception {
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>>(){});
} 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 Exception {
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>>(){});
} else {
throw new IllegalArgumentException("'body' parameter is required");
throw new IllegalArgumentException("'User' parameter is required");
}
imp.createUsersWithListInput(body);
imp.createUsersWithListInput(user);
return ok();
}
@@ -113,14 +113,14 @@ public class UserApiController extends Controller {
@ApiAction
public Result updateUser(String username) throws Exception {
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);
} 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();
}
}

View File

@@ -11,17 +11,17 @@ import java.io.FileInputStream;
public class UserApiControllerImp implements UserApiControllerImpInterface {
@Override
public void createUser(User body) throws Exception {
public void createUser(User user) throws Exception {
//Do your magic!!!
}
@Override
public void createUsersWithArrayInput(List<User> body) throws Exception {
public void createUsersWithArrayInput(List<User> user) throws Exception {
//Do your magic!!!
}
@Override
public void createUsersWithListInput(List<User> body) throws Exception {
public void createUsersWithListInput(List<User> user) throws Exception {
//Do your magic!!!
}
@@ -48,7 +48,7 @@ public class UserApiControllerImp implements UserApiControllerImpInterface {
}
@Override
public void updateUser(String username, User body) throws Exception {
public void updateUser(String username, User user) throws Exception {
//Do your magic!!!
}

View File

@@ -11,11 +11,11 @@ import java.util.HashMap;
@SuppressWarnings("RedundantThrows")
public interface UserApiControllerImpInterface {
void createUser(User body) throws Exception;
void createUser(User user) throws Exception;
void createUsersWithArrayInput(List<User> body) throws Exception;
void createUsersWithArrayInput(List<User> user) throws Exception;
void createUsersWithListInput(List<User> body) throws Exception;
void createUsersWithListInput(List<User> user) throws Exception;
void deleteUser(String username) throws Exception;
@@ -25,6 +25,6 @@ public interface UserApiControllerImpInterface {
void logoutUser() throws Exception;
void updateUser(String username, User body) throws Exception;
void updateUser(String username, User user) throws Exception;
}

View File

@@ -1,4 +1,4 @@
name := """swagger-java-playframework"""
name := """openapi-java-playframework"""
version := "1.0-SNAPSHOT"

View File

@@ -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 (*):

View File

@@ -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");
}
}

Some files were not shown because too many files have changed in this diff Show More