Skip to content

v1.3.3

Choose a tag to compare

@damianmalczewski damianmalczewski released this 12 Feb 17:04
· 102 commits to main since this release
Immutable release. Only release title and notes can be modified.
  1. Maven:
    <dependencies>
        <dependency>
            <groupId>io.github.problem4j</groupId>
            <artifactId>problem4j-core</artifactId>
            <version>1.3.3</version>
        </dependency>
    </dependencies>
  2. Gradle (Kotlin DSL):
    dependencies {
        implementation("io.github.problem4j:problem4j-core:1.3.3")
    }

Fixed

  • Pull back from the idea of returning JSON-alike strings in toString() methods of this library's classes. While it was nice, since Content-Type is named application/problem+json, these strings were not 100% valid JSONs in all scenarios, and it could be tempting to use it as a response body somewhere. Instead of that, toString methods will now produce strings that are simple, useful for logging/debugging and JSON representations should be delegated to jackson-databind and problem4j-jackson, or any other library that may be supported in the future.
  • Seal the contract between toProblemBuilder method overloading in AbstractProblemMapper by making one method final. Any extensions this logic should be performed by overriding the second method as the first one must only delegate to it.
    @Override
    public final ProblemBuilder toProblemBuilder(Throwable t) {
        return toProblemBuilder(t, null);
    }
    
    @Override
    public ProblemBuilder toProblemBuilder(Throwable t, ProblemContext context) {
        // ...
  • Re-use instance of default implementation of ProblemMapper returned by ProblemMapper.create(), because it's thread-safe, stateless and immutable.
  • Make resolution of deprecated HTTP status codes in ProblemStatus lazy, by delegating to nested class.
  • Apply minor improvements to JavaDocs.