{"id":34600270,"url":"https://github.com/problem4j/problem4j-jackson","last_synced_at":"2026-06-05T10:31:41.360Z","repository":{"id":173653873,"uuid":"631422292","full_name":"problem4j/problem4j-jackson","owner":"problem4j","description":"Jackson integration for library implementing RFC7807 (aka RFC9457)","archived":false,"fork":false,"pushed_at":"2026-02-12T17:18:09.000Z","size":430,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-13T00:59:26.986Z","etag":null,"topics":["jackson","java-library","json","problem-details","problem-details-for-http-apis","rfc7807","rfc9457"],"latest_commit_sha":null,"homepage":"https://problem4j.github.io","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/problem4j.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-04-23T01:15:54.000Z","updated_at":"2026-02-12T17:14:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"4ae91b96-e081-4aaa-93ec-5c7b97ca4268","html_url":"https://github.com/problem4j/problem4j-jackson","commit_stats":null,"previous_names":["malczuuu/problem4j-jackson"],"tags_count":33,"template":false,"template_full_name":null,"purl":"pkg:github/problem4j/problem4j-jackson","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/problem4j%2Fproblem4j-jackson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/problem4j%2Fproblem4j-jackson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/problem4j%2Fproblem4j-jackson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/problem4j%2Fproblem4j-jackson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/problem4j","download_url":"https://codeload.github.com/problem4j/problem4j-jackson/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/problem4j%2Fproblem4j-jackson/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29451866,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T15:52:44.973Z","status":"ssl_error","status_checked_at":"2026-02-14T15:52:11.208Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jackson","java-library","json","problem-details","problem-details-for-http-apis","rfc7807","rfc9457"],"created_at":"2025-12-24T12:34:57.735Z","updated_at":"2026-02-17T23:14:01.220Z","avatar_url":"https://github.com/problem4j.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Problem4J Jackson\n\n[![Build Status](https://github.com/problem4j/problem4j-jackson/actions/workflows/gradle-build.yml/badge.svg)](https://github.com/problem4j/problem4j-jackson/actions/workflows/gradle-build.yml)\n[![Sonatype](https://img.shields.io/maven-central/v/io.github.problem4j/problem4j-jackson2?label=problem4j-jackson2)](https://central.sonatype.com/artifact/io.github.problem4j/problem4j-jackson2)\n[![Sonatype](https://img.shields.io/maven-central/v/io.github.problem4j/problem4j-jackson3?label=problem4j-jackson3)](https://central.sonatype.com/artifact/io.github.problem4j/problem4j-jackson3)\n[![License](https://img.shields.io/github/license/problem4j/problem4j-jackson)](https://github.com/problem4j/problem4j-jackson/blob/main/LICENSE)\n\nJackson `2.x` and `3.x` integration module for [`problem4j-core`][problem4j-core]. Provides easy support for serializing\nand deserializing the `Problem` model using [Jackson's `ObjectMapper`][jackson].\n\n\u003e Note that [RFC 7807][rfc7807] was later extended in [RFC 9457][rfc9457], however core concepts remain the same.\n\nProject contains two submodules, `problem4j-jackson2` for Jackson `2.x` and `problem4j-jackson3` for Jackson `3.x`. Both\nmodules have the similar API and functionality, but are compiled against different versions of Jackson (and by extension\nagainst different versions of Java). Choose the one that matches the version of Jackson you are using in your project.\n\n| Module               | Jackson Version                                     | Java Baseline |\n|----------------------|-----------------------------------------------------|---------------|\n| `problem4j-jackson2` | `com.fasterxml.jackson.core:jackson-databind:2.x.y` | Java 8        |\n| `problem4j-jackson3` | `tools.jackson.core:jackson-databind:3.x.y`         | Java 17       |\n\nInstead of releasing version `2.0`, library was split into two modules, because `jackson-3.x` has different maven\n`groupId` so it's technically possible to have both versions of `ObjectMapper` included in the same project.\n\n## Table of Contents\n\n- [Features](#features)\n- [Example](#example)\n    - [Example for `problem4j-jackson2` (Jackson `2.x`)](#example-for-problem4j-jackson2-jackson-2x)\n    - [Example for `problem4j-jackson3` (Jackson `3.x`)](#example-for-problem4j-jackson3-jackson-3x)\n- [Usage](#usage)\n    - [Maven dependency for `problem4j-jackson2` (Jackson `2.x`)](#maven-dependency-for-problem4j-jackson2-jackson-2x)\n    - [Maven dependency for `problem4j-jackson3` (Jackson `3.x`)](#maven-dependency-for-problem4j-jackson3-jackson-3x)\n- [Project Status](#project-status)\n- [Problem4J Links](#problem4j-links)\n- [Building from source](#building-from-source)\n\n## Features\n\n- ✅ Seamless JSON serialization of `Problem` objects.\n- ✅ Accurate deserialization into immutable `Problem` instances.\n- ✅ Compatible with standard Jackson `ObjectMapper`.\n- ✅ Pluggable via Jackson's `Module` system or predefined `MixIn` interface.\n- ✅ Lightweight, with no external dependencies beyond Jackson and `problem4j-core`.\n- ✅ Support for both Jackson2 (`com.fasterxml.jackson`) and Jackson3 (`tools.jackson`).\n- ✅ Integrated with JSpecify annotations for nullability and Kotlin interop (since `v1.4.0`).\n- ✅ Supports **Java Platform Module System** (since `v1.4.0`). Artifact for `problem4j-jackson2` uses multi-release JAR\n  to support Java 8 and Java 9+ module system, while artifact for `problem4j-jackson3` is compiled with Java 17 and\n  supports module system out of the box.\n\n## Example\n\nExamples differ, depending on baseline **Jackson** version.\n\n### Example for `problem4j-jackson2` (Jackson `2.x`)\n\nSerialize and deserialize object using `ObjectMapper` from **Jackson `2.x`**.\n\n```java\nimport com.fasterxml.jackson.databind.ObjectMapper;\nimport io.github.problem4j.core.Problem;\nimport io.github.problem4j.jackson2.ProblemModule;\n\nObjectMapper mapper = new ObjectMapper().registerModule(new ProblemModule());\n\nProblem problem = \n    Problem.builder()\n        .title(\"Bad Request\")\n        .status(400)\n        .detail(\"not a valid json\")\n        .build();\n\nString json = mapper.writeValueAsString(problem);\nProblem parsed = mapper.readValue(json, Problem.class);\n```\n\nModule is included in [`com.fasterxml.jackson.databind.Module`][com.fasterxml.jackson.databind.Module] for automatic\nservice discovery. Registration can also be done with `findAndRegisterModules()` method or by adding a `ProblemMixIn`.\n\n```java\nimport com.fasterxml.jackson.databind.ObjectMapper;\nimport io.github.problem4j.core.Problem;\nimport io.github.problem4j.jackson2.ProblemMixIn;\n\nObjectMapper mapper = new ObjectMapper().findAndRegisterModules();\nObjectMapper mapper = new ObjectMapper().addMixIn(Problem.class, ProblemMixIn.class);\n```\n\nIf using Java module system, add the following `requires` directive to your `module-info.java` file.\n\n```java\nmodule org.example.project {\n    requires io.github.problem4j.jackson2;\n}\n```\n\n### Example for `problem4j-jackson3` (Jackson `3.x`)\n\nSerialize and deserialize object using `JsonMapper` from **Jackson `3.x`**.\n\n```java\nimport io.github.problem4j.core.Problem;\nimport io.github.problem4j.jackson3.ProblemJacksonModule;\nimport tools.jackson.databind.json.JsonMapper;\n\nJsonMapper mapper = JsonMapper.builder().addModule(new ProblemJacksonModule()).build();\n\nProblem problem = \n    Problem.builder()\n        .title(\"Bad Request\")\n        .status(400)\n        .detail(\"not a valid json\")\n        .build();\n\nString json = mapper.writeValueAsString(problem);\nProblem parsed = mapper.readValue(json, Problem.class);\n```\n\nModule is included in [`tools.jackson.databind.JacksonModule`][tools.jackson.databind.JacksonModule] for automatic\nservice discovery. Registration can also be done with `findAndAddModules()` method or by adding a `ProblemJacksonMixIn`.\n\n```java\nimport io.github.problem4j.core.Problem;\nimport io.github.problem4j.jackson3.ProblemJacksonMixIn;\nimport tools.jackson.databind.json.JsonMapper;\n\nJsonMapper mapper = JsonMapper.builder().findAndAddModules().build();\nJsonMapper mapper = JsonMapper.builder().addMixIn(Problem.class, ProblemJacksonMixIn.class).build();\n```\n\nIf using Java module system, add the following `requires` directive to your `module-info.java` file.\n\n```java\nmodule org.example.project {\n    requires io.github.problem4j.jackson3;\n}\n```\n\n## Usage\n\nAdd library as dependency to Maven or Gradle. See the actual versions on [Maven Central][maven-central]. **Java 8** or\nhigher is required to use `problem4j-jackson2` library. **Java 17** or higher is required to use `problem4j-jackson3`\nlibrary.\n\nThe `problem4j-jackson` modules does **not** declare `jackson-databind` as a transitive dependency. You should add\n`jackson-databind` explicitly as your main Jackson dependency.\n\n### Maven dependency for `problem4j-jackson2` (Jackson `2.x`)\n\n1. Maven:\n   ```xml\n   \u003cdependencies\u003e\n       \u003cdependency\u003e\n           \u003cgroupId\u003ecom.fasterxml.jackson.core\u003c/groupId\u003e\n           \u003cartifactId\u003ejackson-databind\u003c/artifactId\u003e\n           \u003cversion\u003e2.21.0\u003c/version\u003e\n       \u003c/dependency\u003e\n       \u003cdependency\u003e\n           \u003cgroupId\u003eio.github.problem4j\u003c/groupId\u003e\n           \u003cartifactId\u003eproblem4j-core\u003c/artifactId\u003e\n           \u003cversion\u003e1.4.1\u003c/version\u003e\n       \u003c/dependency\u003e\n       \u003cdependency\u003e\n           \u003cgroupId\u003eio.github.problem4j\u003c/groupId\u003e\n           \u003cartifactId\u003eproblem4j-jackson2\u003c/artifactId\u003e\n           \u003cversion\u003e1.4.1\u003c/version\u003e\n       \u003c/dependency\u003e\n   \u003c/dependencies\u003e\n   ```\n2. Gradle (Groovy or Kotlin DSL):\n   ```groovy\n   dependencies {\n       implementation(\"com.fasterxml.jackson.core:jackson-databind:2.20.0\")\n       implementation(\"io.github.problem4j:problem4j-core:1.4.1\")\n       implementation(\"io.github.problem4j:problem4j-jackson2:1.4.1\")\n   }\n   ```\n\n### Maven dependency for `problem4j-jackson3` (Jackson `3.x`)\n\n1. Maven:\n   ```xml\n   \u003cdependencies\u003e\n       \u003cdependency\u003e\n           \u003cgroupId\u003etools.jackson.core\u003c/groupId\u003e\n           \u003cartifactId\u003ejackson-databind\u003c/artifactId\u003e\n           \u003cversion\u003e3.0.4\u003c/version\u003e\n       \u003c/dependency\u003e\n       \u003cdependency\u003e\n           \u003cgroupId\u003eio.github.problem4j\u003c/groupId\u003e\n           \u003cartifactId\u003eproblem4j-core\u003c/artifactId\u003e\n           \u003cversion\u003e1.4.1\u003c/version\u003e\n       \u003c/dependency\u003e\n       \u003cdependency\u003e\n           \u003cgroupId\u003eio.github.problem4j\u003c/groupId\u003e\n           \u003cartifactId\u003eproblem4j-jackson3\u003c/artifactId\u003e\n           \u003cversion\u003e1.4.1\u003c/version\u003e\n       \u003c/dependency\u003e\n   \u003c/dependencies\u003e\n   ```\n2. Gradle (Groovy or Kotlin DSL):\n   ```groovy\n   dependencies {\n       implementation(\"tools.jackson.core:jackson-databind:3.0.3\")\n       implementation(\"io.github.problem4j:problem4j-core:1.4.1\")\n       implementation(\"io.github.problem4j:problem4j-jackson3:1.4.1\")\n   }\n   ```\n\n## Project Status\n\n[![Status: Feature Complete](https://img.shields.io/badge/feature%20complete-darkblue?label=status)](#project-status)\n\n**Problem4J Jackson** is considered *feature complete*. Only **bug fixes** will be added. New features may be included\nonly if there is a strong justification for them; otherwise, future projects are expected to build on this one as a\ndependency.\n\n## Problem4J Links\n\n- [`problem4j.github.io`](https://problem4j.github.io) - Full documentation of all projects from Problem4J family.\n- [`problem4j-core`][problem4j-core] - Core library defining `Problem` model and `ProblemException`.\n- [`problem4j-jackson`][problem4j-jackson] - Jackson module for serializing and deserializing `Problem` objects.\n- [`problem4j-spring`][problem4j-spring] - Spring modules extending `ResponseEntityExceptionHandler` for handling\n  exceptions and returning `Problem` responses.\n\n## Building from source\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eExpand...\u003c/b\u003e\u003c/summary\u003e\n\nGradle **9.x+** requires **Java 17+** to run, but higher Java versions can also be used.\n\n- Module `problem4j-jackson2` is compiled using a **Java 8 toolchain**, so the produced artifacts are compatible with\n  **Java 8**.\n- Module `problem4j-jackson3` is compiled using a **Java 17 toolchain**, so the produced artifacts are compatible with\n  **Java 17**.\n\n```bash\n./gradlew build\n```\n\nTo execute tests use `test` task.\n\n```bash\n./gradlew test\n```\n\nTo format the code according to the style defined in [`build.gradle.kts`](./build.gradle.kts) rules use `spotlessApply`\ntask. **Note** that **building will fail** if code is not properly formatted.\n\n```bash\n./gradlew spotlessApply\n```\n\n**Note** that if the year has changed, add `-Pspotless.license-year-enabled` flag to update the year in license headers.\nThe [publishing GitHub Action](.github/workflows/gradle-publish-release.yml) will fail if the year is not updated, but\nfor local development and builds you can choose to skip it and update the year later.\n\n```bash\n./gradlew spotlessApply -Pspotless.license-year-enabled\n```\n\nTo publish the built artifacts to local Maven repository, use `publishToMavenLocal` task. It produces artifacts with\n`0.0.0-SNAPSHOT` version placeholder, so they won't conflict with any released versions in your local repository.\n\n```bash\n./gradlew publishToMavenLocal\n```\n\nNote that for using Maven Local artifacts in target projects, you need to add `mavenLocal()` repository.\n\n```kotlin\nrepositories {\n    mavenLocal()\n    mavenCentral()\n}\n```\n\n---\n\n**Note** that following warnings are to be ignored, as they are caused by the module names containing terminal digits,\nwhich is not recommended but is necessary in this case to differentiate between Jackson 2 and Jackson 3 modules. \nInclusion of digit is a part of the **module name**, not a versioning scheme.\n\n```txt\n\u003e Task :problem4j-jackson2:compileMain9Java\n./problem4j-jackson2/src/main9/java/module-info.java:25: warning: [module] module name component jackson2 should avoid terminal digits\nmodule io.github.problem4j.jackson2 {\n^\n1 warning\n```\n\n```txt\n\u003e Task :problem4j-jackson3:compileJava\n./problem4j-jackson3/src/main/java/module-info.java:25: warning: [module] module name component jackson3 should avoid terminal digits\nmodule io.github.problem4j.jackson3 {\n^\n1 warning\n```\n\n\u003c/details\u003e\n\n[jackson]: https://github.com/FasterXML/jackson\n\n[maven-central]: https://central.sonatype.com/artifact/io.github.problem4j/problem4j-jackson2\n\n[problem4j-core]: https://github.com/problem4j/problem4j-core\n\n[problem4j-jackson]: https://github.com/problem4j/problem4j-jackson\n\n[problem4j-spring]: https://github.com/problem4j/problem4j-spring\n\n[com.fasterxml.jackson.databind.Module]: problem4j-jackson2/src/main/resources/META-INF/services/com.fasterxml.jackson.databind.Module\n\n[tools.jackson.databind.JacksonModule]: problem4j-jackson3/src/main/resources/META-INF/services/tools.jackson.databind.JacksonModule\n\n[rfc7807]: https://datatracker.ietf.org/doc/html/rfc7807\n\n[rfc9457]: https://datatracker.ietf.org/doc/html/rfc9457\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fproblem4j%2Fproblem4j-jackson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fproblem4j%2Fproblem4j-jackson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fproblem4j%2Fproblem4j-jackson/lists"}