Skip to content

Migrate to Jackson 3.1.5 - #3872

Open
staktrace wants to merge 1 commit into
masterfrom
kartikaya.jackson3
Open

Migrate to Jackson 3.1.5#3872
staktrace wants to merge 1 commit into
masterfrom
kartikaya.jackson3

Conversation

@staktrace

@staktrace staktrace commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

Bumps the Jackson BOM from 2.21.2 to 3.1.5 and moves the five Jackson-using source files onto the tools.jackson packages. jackson-annotations is deliberately left on com.fasterxml — it is not renamed in 3.x and the 3.1.5 BOM pins it to 2.21, which is what lets Jackson 2 and 3 coexist on a classpath. jackson-datatype-jsr310 is dropped; java.time support is folded into databind in 3.x.

Three changes are behavioural rather than mechanical:

  • Mappers are immutable in 3.x, but SecretDeserializer and ResourceAwareDeserializer parse nested documents with the very mapper they are registered on. They now take a () -> ObjectMapper supplier that resolves once builder.build() returns. SecretJacksonModule keeps its ObjectMapper constructor and exposes mapper as a computed property, so its source shape is unchanged.

  • FAIL_ON_UNKNOWN_PROPERTIES defaults to false in 3.x. Left alone, MiskConfig's "'x' not found in Config, did you mean...?" warning would silently never fire again and config typos would be ignored. It is now explicitly enabled for the first parse attempt; the retry path used to relax the mapper in place and instead rebuilds one.

  • SORT_PROPERTIES_ALPHABETICALLY and EnumFeature.READ/WRITE_ENUMS_USING_TO_STRING default on in 3.x and are pinned off. Sorting would reshuffle every service's redacted config dashboard, and config enums are matched by name while toString() is frequently overridden for display.

This is a breaking change for consumers. The affected ABI, confirmed by the regenerated api dumps, is limited to: the MiskConfig.load overloads taking JsonNode/ValueDeserializerModifier, the three SimpleModule subclasses in misk-config, and BackwardsCompatibleClientsConfigConverter. Both misk-config and misk expose Jackson via api(...), so consumers relying on the transitive dependency inherit Jackson 3.

Bumps the Jackson BOM from 2.21.2 to 3.1.5 and moves the five Jackson-using
source files onto the `tools.jackson` packages. `jackson-annotations` is
deliberately left on `com.fasterxml` — it is not renamed in 3.x and the 3.1.5
BOM pins it to 2.21, which is what lets Jackson 2 and 3 coexist on a classpath.
`jackson-datatype-jsr310` is dropped; java.time support is folded into
databind in 3.x.

Three changes are behavioural rather than mechanical:

- Mappers are immutable in 3.x, but `SecretDeserializer` and
  `ResourceAwareDeserializer` parse nested documents with the very mapper they
  are registered on. They now take a `() -> ObjectMapper` supplier that
  resolves once `builder.build()` returns. `SecretJacksonModule` keeps its
  `ObjectMapper` constructor and exposes `mapper` as a computed property, so
  its source shape is unchanged.

- `FAIL_ON_UNKNOWN_PROPERTIES` defaults to false in 3.x. Left alone,
  MiskConfig's "'x' not found in Config, did you mean...?" warning would
  silently never fire again and config typos would be ignored. It is now
  explicitly enabled for the first parse attempt; the retry path used to
  relax the mapper in place and instead rebuilds one.

- `SORT_PROPERTIES_ALPHABETICALLY` and `EnumFeature.READ/WRITE_ENUMS_USING_TO_STRING`
  default on in 3.x and are pinned off. Sorting would reshuffle every
  service's redacted config dashboard, and config enums are matched by name
  while `toString()` is frequently overridden for display.

This is a breaking change for consumers. The affected ABI, confirmed by the
regenerated api dumps, is limited to: the `MiskConfig.load` overloads taking
`JsonNode`/`ValueDeserializerModifier`, the three `SimpleModule` subclasses in
misk-config, and `BackwardsCompatibleClientsConfigConverter`. Both misk-config
and misk expose Jackson via `api(...)`, so consumers relying on the transitive
dependency inherit Jackson 3.
@staktrace

Copy link
Copy Markdown
Collaborator Author

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