Skip to content

chore: migrate to Jackson 3 - #700

Merged
ddecrulle merged 2 commits into
mainfrom
feat/jackson3
Nov 4, 2026
Merged

ddecrulle merged 2 commits into
mainfrom
feat/jackson3

Conversation

@ddecrulle

Copy link
Copy Markdown
Member

Why

Spring Boot 4 uses Jackson 3 by default. #636 kept Jackson 2 through the deprecated spring-boot-jackson2 module + spring.http.converters.preferred-json-mapper=jackson2. This PR removes that transitional setup.

What

  • com.fasterxml.jackson.{databind,core,dataformat} → tools.jackson.* in all 3 modules (annotations are unchanged: com.fasterxml.jackson.annotation).
  • CustomObjectMapper now exposes a JsonMapper (@Primary, used by Spring MVC — Boot's auto-configured mapper backs off) and a YAMLMapper for Helm, built with the immutable builder API (defaultSerializationView, changeDefaultPropertyInclusion).
  • Jackson 2 defaults restored where Jackson 3 changed them, so the API contract does not move:
    • DEFAULT_VIEW_INCLUSION (otherwise every property without @JsonView would vanish, since a default view is set)
    • SORT_PROPERTIES_ALPHABETICALLY off, USE_GETTERS_AS_SETTERS, ALLOW_FINAL_FIELDS_AS_MUTATORS, FIX_FIELD_NAME_UPPER_CASE_PREFIX off, DETECT_PARAMETER_NAMES off
    • lenient input: FAIL_ON_NULL_FOR_PRIMITIVES / FAIL_ON_TRAILING_TOKENS off
    • enums via name() (EnumFeature.READ/WRITE_ENUMS_USING_TO_STRING off)
  • JsonNode: fields() → properties(), asText() → asString(). asString() renders null as "" (was "null") and throws on containers: both cases handled to keep previous behaviour (Helm env extraction, overwriteSchemaWith).
  • Jackson exceptions are unchecked now (JacksonException).

Jackson 2 stays on the classpath transitively (fabric8, swagger) — expected, packages don't clash.

Verification

  • mvn test: 91 tests green, spotless:check OK, no deprecated Jackson API left.
  • Before/after JSON snapshot: a throwaway test booted the full app (authentication.mode=none) on main (Jackson 2) and on this branch, and dumped /public/configuration, /public/regions, /public/catalogs, /public/schemas, /my-lab/catalogs, chart details, a launcher JSON schema, /user/info, /profile/schema, plus events, Helm values YAML and lenient/edge-case DTO input. Output is byte-identical, except build.timestamp and catalogs lastUpdateTime, which change on every start.
  • Not covered: endpoints needing a cluster (/my-lab/services, install…), OIDC mode.

🤖 Generated with Claude Code

ddecrulle and others added 2 commits November 4, 2026 10:50
Spring Boot 4 defaults to Jackson 3, drop the transitional
spring-boot-jackson2 module and Jackson 2 HTTP converter.

- com.fasterxml.jackson.{databind,core,dataformat} -> tools.jackson.*
  (annotations stay in com.fasterxml.jackson.annotation)
- CustomObjectMapper now exposes a JsonMapper (picked up by Spring MVC)
  and a YAMLMapper for Helm, built with the immutable builder API
- Restore the Jackson 2 defaults that Jackson 3 changed
  (DEFAULT_VIEW_INCLUSION, SORT_PROPERTIES_ALPHABETICALLY,
  FAIL_ON_NULL_FOR_PRIMITIVES, FAIL_ON_TRAILING_TOKENS, enums via
  name(), ...) so the API contract does not change
- JsonNode: fields() -> properties(), asText() -> asString(), keeping
  "null" rendering for null Helm values
- Jackson exceptions are now unchecked (JacksonException)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Nov 4, 2026

Copy link
Copy Markdown

@ddecrulle
ddecrulle merged commit 7e2156e into main Nov 4, 2026
9 checks passed
@ddecrulle
ddecrulle deleted the feat/jackson3 branch November 4, 2026 10:13
ddecrulle added a commit that referenced this pull request Nov 4, 2026
Resolve import conflicts with the Jackson 3 migration (#700): keep the
tools.jackson imports from main and the jakarta.annotation.PostConstruct
switch from this branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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