From 170dd6f90850dc1a5913f3d244ea7d7834b26fc0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 21 Nov 2024 19:29:42 +0000 Subject: [PATCH 1/2] Bump org.springframework.boot:spring-boot-starter-parent Bumps [org.springframework.boot:spring-boot-starter-parent](https://github.com/spring-projects/spring-boot) from 3.3.5 to 3.4.0. - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.3.5...v3.4.0) --- updated-dependencies: - dependency-name: org.springframework.boot:spring-boot-starter-parent dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9b70845..1899986 100644 --- a/pom.xml +++ b/pom.xml @@ -18,7 +18,7 @@ org.springframework.boot spring-boot-starter-parent - 3.3.5 + 3.4.0 From a20455a58105daafff63cdf46c36017964b5d28a Mon Sep 17 00:00:00 2001 From: Greg Baker Date: Tue, 17 Dec 2024 08:29:44 -0330 Subject: [PATCH 2/2] Remove `handleBindException()` from `ApiErrorHandler` --- .../dtsstn/passport/api/web/ApiErrorHandler.java | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/main/java/ca/gov/dtsstn/passport/api/web/ApiErrorHandler.java b/src/main/java/ca/gov/dtsstn/passport/api/web/ApiErrorHandler.java index 00f347d..e35d5f6 100644 --- a/src/main/java/ca/gov/dtsstn/passport/api/web/ApiErrorHandler.java +++ b/src/main/java/ca/gov/dtsstn/passport/api/web/ApiErrorHandler.java @@ -16,7 +16,6 @@ import org.springframework.http.converter.HttpMessageNotReadableException; import org.springframework.util.Assert; import org.springframework.util.ClassUtils; -import org.springframework.validation.BindException; import org.springframework.validation.FieldError; import org.springframework.web.bind.MethodArgumentNotValidException; import org.springframework.web.bind.ServletRequestBindingException; @@ -51,21 +50,6 @@ public class ApiErrorHandler extends ResponseEntityExceptionHandler { private static final Logger log = LoggerFactory.getLogger(ApiErrorHandler.class); - @Override - protected ResponseEntity handleBindException(BindException ex, HttpHeaders headers, HttpStatusCode status, WebRequest request) { - final var body = ImmutableErrorResponseModel.builder() - .operationOutcome(ImmutableOperationOutcomeModel.builder() - .addAllIssues(ex.getFieldErrors().stream().map(this::toIssue).toList()) - .operationOutcomeStatus(ImmutableOperationOutcomeStatusModel.builder() - .statusCode("400") - .statusDescriptionText("Bad request") // NOSONAR (repeated string) - .build()) - .build()) - .build(); - - return handleExceptionInternal(ex, body, headers, status, request); - } - /** * A {@link HttpMessageNotReadableException} is thrown the {@link HttpMessageConverter#read(Class, HttpInputMessage)} method fails. * (ie: when the incoming JSON is malformed)