diff --git a/modules/openapi-generator/src/main/resources/JavaVertXWebServer/apiHandler.mustache b/modules/openapi-generator/src/main/resources/JavaVertXWebServer/apiHandler.mustache index b8cab88ea443..e9a6bbf0663d 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXWebServer/apiHandler.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXWebServer/apiHandler.mustache @@ -5,7 +5,7 @@ package {{package}}; import com.fasterxml.jackson.core.type.TypeReference; import io.vertx.core.json.jackson.DatabindCodec; -import io.vertx.ext.web.openapi.RouterFactory; +import io.vertx.ext.web.openapi.RouterBuilder; import io.vertx.ext.web.validation.RequestParameters; import io.vertx.ext.web.validation.RequestParameter; import io.vertx.ext.web.validation.ValidationHandler; @@ -27,10 +27,10 @@ public class {{classname}}Handler { this.apiImpl = new {{classname}}Impl(); } - public void mount(RouterFactory factory) { + public void mount(RouterBuilder builder) { {{#operations}} {{#operation}} - factory.operation("{{operationId}}").handler(this::{{operationId}}); + builder.operation("{{operationId}}").handler(this::{{operationId}}); {{/operation}} {{/operations}} } diff --git a/modules/openapi-generator/src/main/resources/JavaVertXWebServer/supportFiles/HttpServerVerticle.mustache b/modules/openapi-generator/src/main/resources/JavaVertXWebServer/supportFiles/HttpServerVerticle.mustache index 51de8394f1a6..03001005bca8 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXWebServer/supportFiles/HttpServerVerticle.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXWebServer/supportFiles/HttpServerVerticle.mustache @@ -5,8 +5,8 @@ import io.vertx.core.Promise; import io.vertx.core.http.HttpServerOptions; import io.vertx.ext.web.Router; import io.vertx.ext.web.RoutingContext; -import io.vertx.ext.web.openapi.RouterFactory; -import io.vertx.ext.web.openapi.RouterFactoryOptions; +import io.vertx.ext.web.openapi.RouterBuilder; +import io.vertx.ext.web.openapi.RouterBuilderOptions; import org.slf4j.Logger; import org.slf4j.LoggerFactory; {{#apiInfo}}{{#apis}} @@ -22,16 +22,16 @@ public class HttpServerVerticle extends AbstractVerticle { @Override public void start(Promise startPromise) { - RouterFactory.create(vertx, specFile) - .map(factory -> { - factory.setOptions(new RouterFactoryOptions() + RouterBuilder.create(vertx, specFile) + .map(builder -> { + builder.setOptions(new RouterBuilderOptions() // For production use case, you need to enable this flag and provide the proper security handler .setRequireSecurityHandlers(false) ); {{#apiInfo}}{{#apis}} - {{classVarName}}Handler.mount(factory);{{/apis}}{{/apiInfo}} + {{classVarName}}Handler.mount(builder);{{/apis}}{{/apiInfo}} - Router router = factory.createRouter(); + Router router = builder.createRouter(); router.errorHandler(400, this::validationFailureHandler); return router; diff --git a/modules/openapi-generator/src/main/resources/JavaVertXWebServer/supportFiles/pom.mustache b/modules/openapi-generator/src/main/resources/JavaVertXWebServer/supportFiles/pom.mustache index 6f3497cd2311..da3bb233cf81 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXWebServer/supportFiles/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXWebServer/supportFiles/pom.mustache @@ -17,8 +17,8 @@ 2.22.2 1.5.0 - 4.0.0.Beta3 - 5.6.2 + 4.0.0 + 5.7.0 1.7.30 2.11.2 diff --git a/samples/server/petstore/java-vertx-web/.openapi-generator/FILES b/samples/server/petstore/java-vertx-web/.openapi-generator/FILES index 4169de32e262..08e93e05a0c4 100644 --- a/samples/server/petstore/java-vertx-web/.openapi-generator/FILES +++ b/samples/server/petstore/java-vertx-web/.openapi-generator/FILES @@ -12,8 +12,6 @@ src/main/java/org/openapitools/vertxweb/server/api/UserApi.java src/main/java/org/openapitools/vertxweb/server/api/UserApiHandler.java src/main/java/org/openapitools/vertxweb/server/api/UserApiImpl.java src/main/java/org/openapitools/vertxweb/server/model/Category.java -src/main/java/org/openapitools/vertxweb/server/model/InlineObject.java -src/main/java/org/openapitools/vertxweb/server/model/InlineObject1.java src/main/java/org/openapitools/vertxweb/server/model/ModelApiResponse.java src/main/java/org/openapitools/vertxweb/server/model/Order.java src/main/java/org/openapitools/vertxweb/server/model/Pet.java diff --git a/samples/server/petstore/java-vertx-web/.openapi-generator/VERSION b/samples/server/petstore/java-vertx-web/.openapi-generator/VERSION index d99e7162d01f..3fa3b389a57d 100644 --- a/samples/server/petstore/java-vertx-web/.openapi-generator/VERSION +++ b/samples/server/petstore/java-vertx-web/.openapi-generator/VERSION @@ -1 +1 @@ -5.0.0-SNAPSHOT \ No newline at end of file +5.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-vertx-web/pom.xml b/samples/server/petstore/java-vertx-web/pom.xml index e813663f8d17..56eebc06b103 100644 --- a/samples/server/petstore/java-vertx-web/pom.xml +++ b/samples/server/petstore/java-vertx-web/pom.xml @@ -17,8 +17,8 @@ 2.22.2 1.5.0 - 4.0.0.Beta3 - 5.6.2 + 4.0.0 + 5.7.0 1.7.30 2.11.2 diff --git a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/HttpServerVerticle.java b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/HttpServerVerticle.java index ceb3d606acd9..f06b6c3e0142 100644 --- a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/HttpServerVerticle.java +++ b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/HttpServerVerticle.java @@ -5,8 +5,8 @@ import io.vertx.core.http.HttpServerOptions; import io.vertx.ext.web.Router; import io.vertx.ext.web.RoutingContext; -import io.vertx.ext.web.openapi.RouterFactory; -import io.vertx.ext.web.openapi.RouterFactoryOptions; +import io.vertx.ext.web.openapi.RouterBuilder; +import io.vertx.ext.web.openapi.RouterBuilderOptions; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -26,18 +26,18 @@ public class HttpServerVerticle extends AbstractVerticle { @Override public void start(Promise startPromise) { - RouterFactory.create(vertx, specFile) - .map(factory -> { - factory.setOptions(new RouterFactoryOptions() + RouterBuilder.create(vertx, specFile) + .map(builder -> { + builder.setOptions(new RouterBuilderOptions() // For production use case, you need to enable this flag and provide the proper security handler .setRequireSecurityHandlers(false) ); - petHandler.mount(factory); - storeHandler.mount(factory); - userHandler.mount(factory); + petHandler.mount(builder); + storeHandler.mount(builder); + userHandler.mount(builder); - Router router = factory.createRouter(); + Router router = builder.createRouter(); router.errorHandler(400, this::validationFailureHandler); return router; diff --git a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/PetApiHandler.java b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/PetApiHandler.java index 9dd5df60d58a..d215f5db7c52 100644 --- a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/PetApiHandler.java +++ b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/PetApiHandler.java @@ -6,7 +6,7 @@ import com.fasterxml.jackson.core.type.TypeReference; import io.vertx.core.json.jackson.DatabindCodec; -import io.vertx.ext.web.openapi.RouterFactory; +import io.vertx.ext.web.openapi.RouterBuilder; import io.vertx.ext.web.validation.RequestParameters; import io.vertx.ext.web.validation.RequestParameter; import io.vertx.ext.web.validation.ValidationHandler; @@ -28,15 +28,15 @@ public PetApiHandler() { this.apiImpl = new PetApiImpl(); } - public void mount(RouterFactory factory) { - factory.operation("addPet").handler(this::addPet); - factory.operation("deletePet").handler(this::deletePet); - factory.operation("findPetsByStatus").handler(this::findPetsByStatus); - factory.operation("findPetsByTags").handler(this::findPetsByTags); - factory.operation("getPetById").handler(this::getPetById); - factory.operation("updatePet").handler(this::updatePet); - factory.operation("updatePetWithForm").handler(this::updatePetWithForm); - factory.operation("uploadFile").handler(this::uploadFile); + public void mount(RouterBuilder builder) { + builder.operation("addPet").handler(this::addPet); + builder.operation("deletePet").handler(this::deletePet); + builder.operation("findPetsByStatus").handler(this::findPetsByStatus); + builder.operation("findPetsByTags").handler(this::findPetsByTags); + builder.operation("getPetById").handler(this::getPetById); + builder.operation("updatePet").handler(this::updatePet); + builder.operation("updatePetWithForm").handler(this::updatePetWithForm); + builder.operation("uploadFile").handler(this::uploadFile); } private void addPet(RoutingContext routingContext) { diff --git a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/StoreApiHandler.java b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/StoreApiHandler.java index 32b410ad2f6c..584f7cc633da 100644 --- a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/StoreApiHandler.java +++ b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/StoreApiHandler.java @@ -4,7 +4,7 @@ import com.fasterxml.jackson.core.type.TypeReference; import io.vertx.core.json.jackson.DatabindCodec; -import io.vertx.ext.web.openapi.RouterFactory; +import io.vertx.ext.web.openapi.RouterBuilder; import io.vertx.ext.web.validation.RequestParameters; import io.vertx.ext.web.validation.RequestParameter; import io.vertx.ext.web.validation.ValidationHandler; @@ -26,11 +26,11 @@ public StoreApiHandler() { this.apiImpl = new StoreApiImpl(); } - public void mount(RouterFactory factory) { - factory.operation("deleteOrder").handler(this::deleteOrder); - factory.operation("getInventory").handler(this::getInventory); - factory.operation("getOrderById").handler(this::getOrderById); - factory.operation("placeOrder").handler(this::placeOrder); + public void mount(RouterBuilder builder) { + builder.operation("deleteOrder").handler(this::deleteOrder); + builder.operation("getInventory").handler(this::getInventory); + builder.operation("getOrderById").handler(this::getOrderById); + builder.operation("placeOrder").handler(this::placeOrder); } private void deleteOrder(RoutingContext routingContext) { diff --git a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApiHandler.java b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApiHandler.java index dfcbd41aef84..db26552844ef 100644 --- a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApiHandler.java +++ b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApiHandler.java @@ -4,7 +4,7 @@ import com.fasterxml.jackson.core.type.TypeReference; import io.vertx.core.json.jackson.DatabindCodec; -import io.vertx.ext.web.openapi.RouterFactory; +import io.vertx.ext.web.openapi.RouterBuilder; import io.vertx.ext.web.validation.RequestParameters; import io.vertx.ext.web.validation.RequestParameter; import io.vertx.ext.web.validation.ValidationHandler; @@ -26,15 +26,15 @@ public UserApiHandler() { this.apiImpl = new UserApiImpl(); } - public void mount(RouterFactory factory) { - factory.operation("createUser").handler(this::createUser); - factory.operation("createUsersWithArrayInput").handler(this::createUsersWithArrayInput); - factory.operation("createUsersWithListInput").handler(this::createUsersWithListInput); - factory.operation("deleteUser").handler(this::deleteUser); - factory.operation("getUserByName").handler(this::getUserByName); - factory.operation("loginUser").handler(this::loginUser); - factory.operation("logoutUser").handler(this::logoutUser); - factory.operation("updateUser").handler(this::updateUser); + public void mount(RouterBuilder builder) { + builder.operation("createUser").handler(this::createUser); + builder.operation("createUsersWithArrayInput").handler(this::createUsersWithArrayInput); + builder.operation("createUsersWithListInput").handler(this::createUsersWithListInput); + builder.operation("deleteUser").handler(this::deleteUser); + builder.operation("getUserByName").handler(this::getUserByName); + builder.operation("loginUser").handler(this::loginUser); + builder.operation("logoutUser").handler(this::logoutUser); + builder.operation("updateUser").handler(this::updateUser); } private void createUser(RoutingContext routingContext) {