From 691d84ebe37c42de3891827017a4f4d2dd8d2022 Mon Sep 17 00:00:00 2001 From: MrSebastian <13592751+MrSebastian@users.noreply.github.com> Date: Tue, 18 Jun 2024 13:20:02 +0200 Subject: [PATCH] remove response body on 404 --- .../eaiservice/configuration/SwaggerConfiguration.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/wls-eai-service/src/main/java/de/muenchen/oss/wahllokalsystem/eaiservice/configuration/SwaggerConfiguration.java b/wls-eai-service/src/main/java/de/muenchen/oss/wahllokalsystem/eaiservice/configuration/SwaggerConfiguration.java index 38921c289..d2fab9fde 100644 --- a/wls-eai-service/src/main/java/de/muenchen/oss/wahllokalsystem/eaiservice/configuration/SwaggerConfiguration.java +++ b/wls-eai-service/src/main/java/de/muenchen/oss/wahllokalsystem/eaiservice/configuration/SwaggerConfiguration.java @@ -61,7 +61,7 @@ private void addErrorToApi(Operation operation, Components components) { if (operation.getResponses() != null) { addRequestBodyValidationErrorToAPI(operation, components); } - addNotFoundErrorToAPI(operation, components); + addNotFoundErrorToAPI(operation); addInternalErrorToAPI(operation, components); addUnhandledCommunicationErrorToAPI(operation, components); } @@ -72,10 +72,9 @@ private void addRequestBodyValidationErrorToAPI(Operation operation, Components .content(new Content().addMediaType(APPLICATION_JSON_VALUE, createWlsExceptionDTOMediaType(components)))); } - private void addNotFoundErrorToAPI(Operation operation, Components components) { + private void addNotFoundErrorToAPI(Operation operation) { operation.getResponses().addApiResponse("404", new ApiResponse() - .description("no resource found") - .content(new Content().addMediaType(APPLICATION_JSON_VALUE, createWlsExceptionDTOMediaType(components)))); + .description("resource not found")); } private void addInternalErrorToAPI(Operation operation, Components components) {