Add msgpack-jackson3 module for Jackson 3.x support#987
Open
komamitsu wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a new msgpack-jackson3 submodule that ports the existing Jackson 2.x MessagePack integration to Jackson 3.x (tools.jackson namespace). It is published as a separate artifact (jackson-dataformat-msgpack-jackson3), requires Java 17+, and is conditionally included in the SBT build / CI / release pipelines so existing Java 8 users of msgpack-jackson are unaffected.
Changes:
- New
msgpack-jackson3module mirroringmsgpack-jackson, adapted for Jackson 3 APIs (ObjectWriteContext/ObjectReadContext,TokenStreamLocation,ValueSerializer/ValueDeserializer, builder-styleMapperBuilder/TSFBuilder, etc.) and including a lightweightMessagePackWriteContextreplacement forSimpleStreamWriteContext. - SBT build, CI workflow, and release workflow updated to compile/test/publish the new module only on JDK 17+, plus a new
sbt-jmhplugin and JMH benchmarks undersrc/jmh/java. - Numerous regression tests covering tricky edge cases (null keys, write-context state, dup-detection NPEs, root-scalar ordering, multi-root containers,
writeNumber(String)NaN/Infinity, etc.).
Reviewed changes
Copilot reviewed 41 out of 42 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
build.sbt |
Adds msgpack-jackson3 project, JMH plugin, Java 17 gating via isJava17Plus. |
project/plugins.sbt |
Adds sbt-jmh plugin. |
.github/workflows/CI.yml |
Skips msgpack-jackson3 tests on JDKs < 17. |
.github/workflows/release.yml |
Splits publishing so jackson3 is only published with JDK 17. |
msgpack-jackson3/README.md |
New documentation for the Jackson 3 module. |
msgpack-jackson3/src/main/java/.../MessagePackFactory.java |
Jackson 3 BinaryTSFactory implementation. |
msgpack-jackson3/src/main/java/.../MessagePackFactoryBuilder.java |
New TSFBuilder for the factory. |
msgpack-jackson3/src/main/java/.../MessagePackGenerator.java |
Port of generator; uses new MessagePackWriteContext, node-buffering model. |
msgpack-jackson3/src/main/java/.../MessagePackParser.java |
Port of parser to ParserMinimalBase; uses MessagePackReadContext. |
msgpack-jackson3/src/main/java/.../MessagePackReadContext.java |
Read context (replaces JsonReadContext). |
msgpack-jackson3/src/main/java/.../MessagePackWriteContext.java |
Lightweight write context. |
msgpack-jackson3/src/main/java/.../MessagePackMapper.java |
ObjectMapper subclass with new builder API. |
msgpack-jackson3/src/main/java/.../MessagePackSerializerFactory.java |
Custom serializer factory installing key serializer. |
msgpack-jackson3/src/main/java/.../MessagePackSerializedString.java |
SerializableString impl tolerant of null values. |
msgpack-jackson3/src/main/java/.../MessagePackKeySerializer.java |
Key serializer using MessagePackSerializedString. |
msgpack-jackson3/src/main/java/.../MessagePackExtensionType.java |
Extension type value + serializer. |
msgpack-jackson3/src/main/java/.../ExtensionTypeCustomDeserializers.java |
Per-type extension deserializer registry. |
msgpack-jackson3/src/main/java/.../TimestampExtensionModule.java |
Module serializing Instant as msgpack timestamp ext type. |
msgpack-jackson3/src/main/java/.../JsonArrayFormat.java |
AnnotationIntrospector forcing ARRAY shape. |
msgpack-jackson3/src/main/java/.../PackageVersion.java |
Hard-coded package version. |
msgpack-jackson3/src/main/java/.../Tuple.java |
Small Tuple helper. |
msgpack-jackson3/src/test/java/... |
Ported test suite plus new regression tests for Jackson 3 specific behavior. |
msgpack-jackson3/src/jmh/java/... |
New JMH benchmarks (read/write/UTF-8) and model classes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
Author
|
@xerial Can you take a quick look at the changes of |
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
msgpack-jackson3submodule (jackson-dataformat-msgpack3) that ports the existing Jackson 2.x integration to Jackson 3.x (tools.jacksonnamespace)src/jmh/java) runnable via./sbt "msgpack-jackson3/jmh:run"Key differences from
msgpack-jacksoncom.fasterxml.jackson→tools.jacksonTokenStreamLocationreplacesJsonLocation; byte offset passed ascolumnNrMessagePackWriteContextreplacesSimpleStreamWriteContext