From 7bdf04db70aa877931e23c2134010d375dd13ea8 Mon Sep 17 00:00:00 2001 From: Sean Brown <54456539+seanbrown-com@users.noreply.github.com> Date: Fri, 11 Feb 2022 23:02:59 -0800 Subject: [PATCH] [java][vertx] moved HttpStatusException (vertx internal) to HttpException (public) (#11550) * Update apiImpl.mustache Vertx has moved HttpStatusException (vertx internal) to HttpException (public) https://github.com/vert-x3/wiki/wiki/4.1.0-Deprecations-and-breaking-changes#iovertxextwebhandlerimplhttpstatusexception * Update java vertx server verx version Co-authored-by: Sean Brown --- .../resources/JavaVertXServer/pom.mustache | 2 +- .../JavaVertXWebServer/apiImpl.mustache | 4 ++-- .../vertxweb/server/api/PetApiImpl.java | 20 +++++++++---------- .../vertxweb/server/api/StoreApiImpl.java | 10 +++++----- .../vertxweb/server/api/UserApiImpl.java | 19 +++++++++--------- 5 files changed, 27 insertions(+), 28 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/JavaVertXServer/pom.mustache b/modules/openapi-generator/src/main/resources/JavaVertXServer/pom.mustache index 3fdedc85a2a7..4c76c2f62060 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXServer/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXServer/pom.mustache @@ -13,7 +13,7 @@ UTF-8 1.8 4.13.1 - 3.4.1 + 4.2.4 3.8.1 {{vertxSwaggerRouterVersion}} 2.3 diff --git a/modules/openapi-generator/src/main/resources/JavaVertXWebServer/apiImpl.mustache b/modules/openapi-generator/src/main/resources/JavaVertXWebServer/apiImpl.mustache index 341e68eb5771..c84106efecce 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXWebServer/apiImpl.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXWebServer/apiImpl.mustache @@ -7,7 +7,7 @@ import {{invokerPackage}}.ApiResponse; import io.vertx.core.Future; import io.vertx.core.json.JsonObject; -import io.vertx.ext.web.handler.impl.HttpStatusException; +import io.vertx.ext.web.handler.HttpException; import java.util.List; import java.util.Map; @@ -18,7 +18,7 @@ public class {{classname}}Impl implements {{classname}} { {{#operations}} {{#operation}} public Future> {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) { - return Future.failedFuture(new HttpStatusException(501)); + return Future.failedFuture(new HttpException(501)); } {{/operation}} diff --git a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/PetApiImpl.java b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/PetApiImpl.java index f06dfd3ae29f..c3daaf53230e 100644 --- a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/PetApiImpl.java +++ b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/PetApiImpl.java @@ -8,7 +8,7 @@ import org.openapitools.vertxweb.server.ApiResponse; import io.vertx.core.Future; import io.vertx.core.json.JsonObject; -import io.vertx.ext.web.handler.impl.HttpStatusException; +import io.vertx.ext.web.handler.HttpException; import java.util.List; import java.util.Map; @@ -17,35 +17,35 @@ import java.util.Map; public class PetApiImpl implements PetApi { public Future> addPet(Pet pet) { - return Future.failedFuture(new HttpStatusException(501)); + return Future.failedFuture(new HttpException(501)); } public Future> deletePet(Long petId, String apiKey) { - return Future.failedFuture(new HttpStatusException(501)); + return Future.failedFuture(new HttpException(501)); } public Future>> findPetsByStatus(List status) { - return Future.failedFuture(new HttpStatusException(501)); + return Future.failedFuture(new HttpException(501)); } public Future>> findPetsByTags(List tags) { - return Future.failedFuture(new HttpStatusException(501)); + return Future.failedFuture(new HttpException(501)); } public Future> getPetById(Long petId) { - return Future.failedFuture(new HttpStatusException(501)); + return Future.failedFuture(new HttpException(501)); } public Future> updatePet(Pet pet) { - return Future.failedFuture(new HttpStatusException(501)); + return Future.failedFuture(new HttpException(501)); } public Future> updatePetWithForm(Long petId, JsonObject formBody) { - return Future.failedFuture(new HttpStatusException(501)); + return Future.failedFuture(new HttpException(501)); } - public Future> uploadFile(Long petId, FileUpload _file) { - return Future.failedFuture(new HttpStatusException(501)); + public Future> uploadFile(Long petId, FileUpload file) { + return Future.failedFuture(new HttpException(501)); } } diff --git a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/StoreApiImpl.java b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/StoreApiImpl.java index d542d3be96c1..1bc8d437a05d 100644 --- a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/StoreApiImpl.java +++ b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/StoreApiImpl.java @@ -6,7 +6,7 @@ import org.openapitools.vertxweb.server.ApiResponse; import io.vertx.core.Future; import io.vertx.core.json.JsonObject; -import io.vertx.ext.web.handler.impl.HttpStatusException; +import io.vertx.ext.web.handler.HttpException; import java.util.List; import java.util.Map; @@ -15,19 +15,19 @@ import java.util.Map; public class StoreApiImpl implements StoreApi { public Future> deleteOrder(String orderId) { - return Future.failedFuture(new HttpStatusException(501)); + return Future.failedFuture(new HttpException(501)); } public Future>> getInventory() { - return Future.failedFuture(new HttpStatusException(501)); + return Future.failedFuture(new HttpException(501)); } public Future> getOrderById(Long orderId) { - return Future.failedFuture(new HttpStatusException(501)); + return Future.failedFuture(new HttpException(501)); } public Future> placeOrder(Order order) { - return Future.failedFuture(new HttpStatusException(501)); + return Future.failedFuture(new HttpException(501)); } } diff --git a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApiImpl.java b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApiImpl.java index b2097db1dec0..48324ba8ee08 100644 --- a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApiImpl.java +++ b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApiImpl.java @@ -1,13 +1,12 @@ package org.openapitools.vertxweb.server.api; -import java.time.OffsetDateTime; import org.openapitools.vertxweb.server.model.User; import org.openapitools.vertxweb.server.ApiResponse; import io.vertx.core.Future; import io.vertx.core.json.JsonObject; -import io.vertx.ext.web.handler.impl.HttpStatusException; +import io.vertx.ext.web.handler.HttpException; import java.util.List; import java.util.Map; @@ -16,35 +15,35 @@ import java.util.Map; public class UserApiImpl implements UserApi { public Future> createUser(User user) { - return Future.failedFuture(new HttpStatusException(501)); + return Future.failedFuture(new HttpException(501)); } public Future> createUsersWithArrayInput(List user) { - return Future.failedFuture(new HttpStatusException(501)); + return Future.failedFuture(new HttpException(501)); } public Future> createUsersWithListInput(List user) { - return Future.failedFuture(new HttpStatusException(501)); + return Future.failedFuture(new HttpException(501)); } public Future> deleteUser(String username) { - return Future.failedFuture(new HttpStatusException(501)); + return Future.failedFuture(new HttpException(501)); } public Future> getUserByName(String username) { - return Future.failedFuture(new HttpStatusException(501)); + return Future.failedFuture(new HttpException(501)); } public Future> loginUser(String username, String password) { - return Future.failedFuture(new HttpStatusException(501)); + return Future.failedFuture(new HttpException(501)); } public Future> logoutUser() { - return Future.failedFuture(new HttpStatusException(501)); + return Future.failedFuture(new HttpException(501)); } public Future> updateUser(String username, User user) { - return Future.failedFuture(new HttpStatusException(501)); + return Future.failedFuture(new HttpException(501)); } }