Skip to content

feat(api)!: register missing exceptions and consolidate error builders - #120

Draft
etiennej70 wants to merge 2 commits into
mainfrom
feat/error_messages
Draft

feat(api)!: register missing exceptions and consolidate error builders#120
etiennej70 wants to merge 2 commits into
mainfrom
feat/error_messages

Conversation

@etiennej70

@etiennej70 etiennej70 commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

PR Description

What this PR Provides

  • Enable Spring Boot native Problem Details handling with spring.mvc.problemdetails.enabled=true.
  • Refactor the central API exception handler to return RFC 7807 / RFC 9457 ProblemDetail responses.
  • Keep the domain layer HTTP-agnostic by centralizing exception-to-status mapping in infrastructure.
  • Update Swagger/OpenAPI responses to document the real error contract with ProblemDetail.
  • Refresh integration tests and the published docs/src/static/swagger.yaml to match the new error format.

Review

The reviewer must double-check these points:

  • The reviewer has tested the feature
  • The reviewer has reviewed the implementation of the feature
  • The documentation has been updated
  • The feature implementation respects the Technical Doc / ADR previously produced
  • The Pull Request title has a ! after the type/scope to identify the breaking change in the release note and ensure we will release a major version.

How to test

Please refer (copy/paste) the test section from the User Story. This should include

  • The initial state: the project runs with the local profile and a PostgreSQL database available.
  • What and how to test: trigger validation, not-found, conflict, unauthorized, and unprocessable-content API errors through the REST endpoints.
  • Expected results: error responses return application/problem+json with RFC 7807 fields (type, title, status, detail, instance), and Swagger documents those responses with ProblemDetail.

Breaking changes (if any)

  • API JSON schema modification (existing resource / behavior)
  • Behavior modification of a component
  • Others

Context of the Breaking Change

The API error contract moved from the custom {error, error_description} shape to Spring's native Problem Details format.

Result of the Breaking Change

API consumers must read RFC 7807 fields from application/problem+json responses instead of the old custom error payload.

@etiennej70 etiennej70 changed the title fix(api)!: register missing exceptions and consolidate error builders feat(api)!: register missing exceptions and consolidate error builders Aug 6, 2026
@sonarqubecloud

sonarqubecloud Bot commented Aug 6, 2026

Copy link
Copy Markdown

@github-code-quality

Copy link
Copy Markdown

Code Coverage Overview

Languages: Java

Java / code-coverage/jacoco

The overall coverage in commit a26e858 in the feat/error_messages branch remains at 91%, unchanged from commit 8dfc367 in the main branch.

Show a code coverage summary of the most impacted files.
File main 8dfc367 feat/error_messages a26e858 +/-
com/decathlon/i...ionHandler.java 83% 94% +11%

@etiennej70
etiennej70 force-pushed the feat/error_messages branch from a26e858 to 513350b Compare August 6, 2026 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant