Spring Boot integrations for RFC 7807 "Problem Details" - consistent error responses for REST APIs using immutable
Problem objects. Supports Spring WebMVC and WebFlux.
| Module | Purpose | Entry point |
|---|---|---|
problem4j-spring-bom |
BOM for dependency alignment | - |
problem4j-spring-web |
Core Spring integration | ProblemAutoConfiguration |
problem4j-spring-webmvc |
WebMVC overrides | ProblemWebMvcAutoConfiguration |
problem4j-spring-webflux |
WebFlux overrides | ProblemWebFluxAutoConfiguration |
Prioritize changes in the module matching the Spring integration in context.
Requires JDK 17+. Dependencies managed in gradle/libs.versions.toml. Custom Gradle plugins live in buildSrc.
./gradlew # default: spotlessApply build (preferred)
./gradlew spotlessApply # auto-format code
./gradlew build # compile + test + spotlessCheck
./gradlew test # tests onlyAlways validate changes with a full build and test run before considering the task complete.
- Do not use terminal commands (e.g.,
cat,find,ls) to read or list project files - use IDE/agent tools instead. - Run tests once, save output to
build/test-run.loginside the repo (> build/test-run.log 2>&1), then read from that file to extract errors. Never run the same test command multiple times, without changes in sources. Store test output in multiple files if you want to compare before/after changes (ex.build/test-run-{i}.log).
- No self-explaining comments - only add comments for non-obvious context.
- No wildcard imports.
- Follow existing code patterns and naming conventions.
- Let
spotlessApplyhandle all formatting - never format manually.
- Method naming:
givenThis_whenThat_thenWhat. - No
// given,// when,// thensection comments. - Cover both positive and negative cases.
- Use AssertJ for assertions.
- Integration tests in
problem4j-spring-webfluxandproblem4j-spring-webmvc(...integrationpackage) should be similar - both modules must resolve the same exceptions to the same response bodies.