Skip to content

Use MessagePackMapper in the README examples - #22

Merged
komamitsu merged 2 commits into
mainfrom
readme-messagepackmapper
Oct 1, 2026
Merged

komamitsu merged 2 commits into
mainfrom
readme-messagepackmapper

Conversation

@komamitsu

Copy link
Copy Markdown
Owner

Summary

The README showed new ObjectMapper(new MessagePackFactory()) as the basic setup, but a plain ObjectMapper lacks what MessagePackMapper configures:

  • A UUID is written as 16 bytes of binary, and reading it back fails with InvalidFormatException.
  • A map key the mapper cannot read back (for example a record) is written instead of refused.

Changes:

  • The basic usage example uses new MessagePackMapper(); the separate "Or more easily" block is removed.
  • The BigDecimal "equivalent configuration" example called configOverride(...) on a built mapper, which does not exist on a Jackson 3 ObjectMapper. It now uses MessagePackMapper.builder().withConfigOverride(...).
  • The extension type example uses new MessagePackMapper(new MessagePackFactory()...).

Testing

Compiled and ran the three updated snippets against 3.0.0 from Maven Central; each produces the output the README states.

A plain ObjectMapper on MessagePackFactory lacks what MessagePackMapper sets up: a UUID
is written as binary that cannot be read back, and a map key that cannot be read back
is written instead of refused. The BigDecimal example also mutated the mapper after
construction, which Jackson 3 no longer allows; build it with withConfigOverride
instead.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The examples match the current APIs and intended round-trip behavior; only a minor grammar nit remains.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
What changed in this PR

Updates README examples to use MessagePackMapper and its Jackson 3-compatible builder APIs.

Changes:

  • Uses MessagePackMapper in basic and extension-type examples.
  • Corrects the BigInteger/BigDecimal configuration example.
File Description
README.md Modernizes mapper setup and configuration examples.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread README.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The documentation examples match the current MessagePackMapper API and intended behavior.

Review effort: Balanced
Findings: None

Resolved since last review (1)

@komamitsu
komamitsu merged commit 06174f2 into main Oct 1, 2026
5 checks passed
@komamitsu
komamitsu deleted the readme-messagepackmapper branch October 1, 2026 15:08
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.

2 participants