Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

jsonapi-java-jackson3

Native Jackson 3 implementation of the major-neutral Level-1 JSON:API contract, plus advanced document codec, mapping, flat binding, typed-envelope, and PATCH capabilities.

Jackson support

The minimum supported and published dependency baseline is Jackson 3.1.7 for jackson-databind, on the sustainable 3.1 LTS line. Consumer or framework dependency management may select newer compatible Jackson 3 versions.

The separate current-test Jackson 3 version reference lives in the version catalog. Renovate maintains that reference without raising the published minimum. See the build commands for minimum and current test runs and the dependency policy for publication and framework boundaries.

Packages

Package Responsibility
com.kazforge.jsonapi.jackson3 Public configured runtime, factory, codec, mapping/binding, typed-envelope, and PATCH entry points
com.kazforge.jsonapi.jackson3.mapping Public RelationshipLinkageMapper contract
com.kazforge.jsonapi.jackson3.internal Mapping, binding, PATCH, and module implementation; unsupported API
com.kazforge.jsonapi.jackson3.internal.codec Self-contained token codec and wire-helper implementation; unsupported API

Start with Level 1

import tools.jackson.databind.json.JsonMapper;

JsonMapper mapper = JsonMapper.builder().build();
Jackson3JsonApi api = JsonApiJackson3.jsonApi(mapper);

String json = api.resources().writeOne(article);
Article readBack = api.resources().readOne(json, Article.class);
ArticlePatch patch = api.patches().readPatch(updateJson, ArticlePatch.class);

The runtime implements the neutral JsonApi facets: resources, linkage relationships, raw documents, and PATCH. Resource reads are strict and homogeneous; create/update authoring selects the corresponding core validation usage. Use JsonApiJackson3.builder(mapper) for application-lifetime identifier conversion, linkage mappers, representation policy, decorators, or an optional default jsonapi.version. Selection, document envelopes, and expected update identity remain per-operation values.

Advanced entry points

JsonApiJackson3 creates each capability from a caller-configured JsonMapper:

Capability Public API
Validated document codec JsonApiDocumentReader, JsonApiDocumentWriter
Domain mapping and flat binding JsonApiResourceMapper, JsonApiResourceBinder
Heterogeneous typed documents JsonApiDomainDocumentReader, JsonApiDomainDocument
Presence-aware PATCH JsonApiPatchCommandReader, JsonApiPatchDtoReader

Use them when Level 1 is not enough, for example a parameterized root JavaType, heterogeneous typed envelopes over an explicit ResourceTypeRegistry, or direct codec and mapping composition. Each type's Javadoc owns its contract.

Neutral contracts come from jsonapi-java-api and backend-neutral mapping semantics from jsonapi-java-mapping. This adapter implements their capability interfaces over configured Jackson 3: property and type discovery, naming, conversion, construction, and native diagnostics. The architecture overview owns that split.

Jackson 3 boundary

  • Production integration uses tools.jackson.* and must not import com.fasterxml.jackson.* or com.kazforge.jsonapi.core.internal.
  • Public advanced APIs follow Jackson 3's unchecked exception model; caller-owned streams, writers, parsers, and generators remain open.
  • Factories never mutate the caller mapper. Capabilities derive isolated mappers only when native modules or introspection state require it.
  • The public composition package may depend on mapping and the two internal responsibilities; mapping and internal.codec do not depend back on composition or on sibling internals.
  • Supported signatures do not expose the unsupported com.kazforge.jsonapi.mapping.internal helpers or this adapter's internal implementation packages, and this module does not redeclare neutral contract types.
  • Jackson 3 property, serializer/deserializer, and PATCH-marker mechanics stay adapter-local. The PatchPresence module is registered only on derived typed-PATCH mappers, never the caller mapper.

Non-goals

This module does not provide HTTP or media-type policy, query parsing, field authorization, persistence lookup or projection execution, graph hydration, PATCH authorization, or mutation of application state. It does not detect another Jackson major at runtime.

See the architecture overview, conformance checklist, ADR-004, and ADR-012.