Use MessagePackMapper in the README examples - #22
Merged
Merged
Conversation
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.
There was a problem hiding this comment.
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
Open (1)
What changed in this PR
Updates README examples to use MessagePackMapper and its Jackson 3-compatible builder APIs.
Changes:
- Uses
MessagePackMapperin 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
The README showed
new ObjectMapper(new MessagePackFactory())as the basic setup, but a plainObjectMapperlacks whatMessagePackMapperconfigures:UUIDis written as 16 bytes of binary, and reading it back fails withInvalidFormatException.Changes:
new MessagePackMapper(); the separate "Or more easily" block is removed.configOverride(...)on a built mapper, which does not exist on a Jackson 3ObjectMapper. It now usesMessagePackMapper.builder().withConfigOverride(...).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.