Skip to content

Update SDK dependencies and JSON handling - #2003

Open
mokuzon wants to merge 1 commit into
users/mokuson/json-compatibility-testsfrom
users/mokuson/upgrade-jackson3-dependencies
Open

mokuzon wants to merge 1 commit into
users/mokuson/json-compatibility-testsfrom
users/mokuson/upgrade-jackson3-dependencies

Conversation

@mokuzon

@mokuzon mokuzon commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Update the SDK's directly declared dependencies and migrate JSON handling.
This is the second PR in the stack and depends on #2004.

Changes

  • Update declared dependencies, including OkHttp; use Gson for integration-test JJWT and remove
    unused dependency entries.
  • Migrate shared mappers, JSON/YAML binding, and webhook parsing to the new Jackson APIs.
  • Replace Retrofit's Jackson converter with an SDK converter, preserving request/response handling
    and when builder settings take effect.
  • Preserve mapper defaults, including null primitives, timestamps, and input limits, and
    integration-test YAML behavior.
  • Preserve public IOException constructors, the exception hierarchy, and IOException handling
    for JSON failures. Response I/O failures retain the original exception.
  • Preserve application-defined objectMapper beans and explicitly select the SDK mapper in the
    audience-management sample to retain unknown-enum handling.

The regression tests from #2004 run against both implementations with the same assertions;
Jackson-specific imports are updated as needed.

Breaking changes

The SDK's client exception hierarchy and public IOException constructors remain compatible.
Use this table to identify changes needed in application code.

If your application… Required change
Uses ModelObjectMapper.createNewObjectMapper(), BotAwareJacksonConverter.create(...), or LineBotAutoConfiguration.objectMapper(). Replace com.fasterxml.jackson.databind.ObjectMapper with tools.jackson.databind.ObjectMapper and recompile. The changed parameter/return types are not binary compatible.
Injects the SDK's mapper in Spring. Update the injected type as above. If a primary jacksonJsonMapper also exists, use @Qualifier("objectMapper") to select the SDK's bean. An application-defined bean named objectMapper still takes precedence.
Changes a mapper using configure(...) or registerModule(...). Configure a builder, such as mapper.rebuild(), and use the mapper returned by build(). Existing mappers cannot be reconfigured.
Provides custom Jackson serializers, deserializers, or modules. Migrate them to the tools.jackson APIs. Updating only the ObjectMapper import is insufficient.
Catches Jackson-specific exceptions (com.fasterxml.jackson.*) from parseErrorBody(...), WebhookParser.handle(...), or client JSON conversion. Handle IOException. JSON failures now use an IOException wrapper whose cause is a tools.jackson.core.JacksonException subtype. parseErrorBody(...) now declares only IOException; subclasses catching it continue to work.
Casts LineClientJsonParseException.getCause() to the old StreamReadException or DatabindException. Treat getCause() as IOException. If Jackson-specific details are needed, the new Jackson exception is at getCause().getCause().
Catches IOException around direct mapper calls such as readValue(...) or writeValueAsString(...). Catch tools.jackson.core.JacksonException for JSON failures; it is unchecked. Handle actual I/O failures separately where required by the method. SDK exception wrapping does not apply to direct mapper calls.
Uses classes supplied transitively by com.fasterxml.jackson.core:jackson-core, com.fasterxml.jackson.core:jackson-databind, com.fasterxml.jackson.datatype:jackson-datatype-jsr310, or com.squareup.retrofit2:converter-jackson. Migrate those usages to the new Jackson APIs / SDK converter, or declare the dependencies explicitly. The SDK no longer supplies these artifacts.
Relies on generated record parsing to reject duplicate properties. Validate duplicates before binding if rejection is required. Some previously rejected inputs now use the last value—for example, endpoint, then active, then another endpoint in GetWebhookEndpointResponse. There is no setting to restore the previous record-construction timing.

The shared com.fasterxml.jackson.annotation annotations remain in use. Response I/O failures still
preserve the original exception instance.

@mokuzon
mokuzon force-pushed the users/mokuson/upgrade-jackson3-dependencies branch from 6db8d07 to d9d846b Compare October 22, 2026 05:14
@mokuzon mokuzon changed the title Upgrade SDK serialization to Jackson 3 for v11 Upgrade SDK serialization to Jackson 3 Oct 22, 2026
@mokuzon mokuzon changed the title Upgrade SDK serialization to Jackson 3 Update SDK dependencies and JSON handling Oct 22, 2026
@mokuzon
mokuzon changed the base branch from master to users/mokuson/json-compatibility-tests October 22, 2026 08:07
@mokuzon
mokuzon force-pushed the users/mokuson/json-compatibility-tests branch from 959bec7 to 7408b11 Compare October 22, 2026 09:45
@mokuzon
mokuzon force-pushed the users/mokuson/upgrade-jackson3-dependencies branch from a999811 to 6824464 Compare October 22, 2026 09:45
@mokuzon
mokuzon marked this pull request as ready for review October 22, 2026 09:53
@mokuzon mokuzon self-assigned this Oct 22, 2026
@mokuzon
mokuzon requested a review from a team October 22, 2026 09:53
@mokuzon
mokuzon force-pushed the users/mokuson/json-compatibility-tests branch from 7408b11 to ff702bc Compare October 22, 2026 13:01
@mokuzon
mokuzon force-pushed the users/mokuson/upgrade-jackson3-dependencies branch from 6824464 to 007f758 Compare October 22, 2026 13:01
@mokuzon
mokuzon force-pushed the users/mokuson/json-compatibility-tests branch from ff702bc to a233478 Compare October 22, 2026 13:06
@mokuzon
mokuzon force-pushed the users/mokuson/upgrade-jackson3-dependencies branch from 007f758 to 1d8e59c Compare October 22, 2026 13:06
@mokuzon
mokuzon force-pushed the users/mokuson/json-compatibility-tests branch from a233478 to 139cdf4 Compare October 22, 2026 13:10
@mokuzon
mokuzon force-pushed the users/mokuson/upgrade-jackson3-dependencies branch from 1d8e59c to 04ddea0 Compare October 22, 2026 13:10
@mokuzon
mokuzon force-pushed the users/mokuson/json-compatibility-tests branch from 139cdf4 to fb2b369 Compare October 22, 2026 13:11
@mokuzon
mokuzon force-pushed the users/mokuson/upgrade-jackson3-dependencies branch from 04ddea0 to d7fcc32 Compare October 22, 2026 13:11
@mokuzon
mokuzon marked this pull request as draft October 22, 2026 13:13
@mokuzon
mokuzon force-pushed the users/mokuson/upgrade-jackson3-dependencies branch 2 times, most recently from 4cdc8f4 to b9dfbff Compare October 22, 2026 13:21
@mokuzon
mokuzon marked this pull request as ready for review October 22, 2026 14:10
@mokuzon
mokuzon force-pushed the users/mokuson/json-compatibility-tests branch from fb2b369 to 4efb38a Compare October 22, 2026 14:15
@mokuzon
mokuzon force-pushed the users/mokuson/upgrade-jackson3-dependencies branch 3 times, most recently from 44941dc to bb9867f Compare October 22, 2026 14:18
@mokuzon
mokuzon force-pushed the users/mokuson/json-compatibility-tests branch from 4efb38a to 8862057 Compare October 22, 2026 14:27
@mokuzon
mokuzon force-pushed the users/mokuson/upgrade-jackson3-dependencies branch from bb9867f to 6d26b83 Compare October 22, 2026 14:27
@mokuzon
mokuzon force-pushed the users/mokuson/json-compatibility-tests branch from 8862057 to b612bc6 Compare October 22, 2026 14:29
@mokuzon
mokuzon force-pushed the users/mokuson/upgrade-jackson3-dependencies branch from 6d26b83 to 46f4c6f Compare October 22, 2026 14:29
@mokuzon
mokuzon force-pushed the users/mokuson/json-compatibility-tests branch from b612bc6 to 3797a5d Compare October 22, 2026 14:31
@mokuzon
mokuzon force-pushed the users/mokuson/upgrade-jackson3-dependencies branch from 46f4c6f to 87e84d0 Compare October 22, 2026 14:32
@mokuzon
mokuzon force-pushed the users/mokuson/json-compatibility-tests branch from 3797a5d to c9dd6e8 Compare October 22, 2026 15:29
@mokuzon
mokuzon force-pushed the users/mokuson/upgrade-jackson3-dependencies branch 2 times, most recently from 33b25a5 to 6232704 Compare October 22, 2026 15:33
@mokuzon
mokuzon force-pushed the users/mokuson/json-compatibility-tests branch from c9dd6e8 to 0c0badd Compare October 22, 2026 15:33
@mokuzon
mokuzon force-pushed the users/mokuson/upgrade-jackson3-dependencies branch from 6232704 to 2dd0310 Compare October 22, 2026 16:03
@mokuzon
mokuzon force-pushed the users/mokuson/json-compatibility-tests branch from 0c0badd to 5c4fb6e Compare October 22, 2026 16:03
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