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 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)