jackson ObjectMapper: auto-detect modules#1643
Merged
Xtansia merged 1 commit intoopensearch-project:mainfrom Jun 24, 2025
Merged
Conversation
9ca9142 to
2a17b0e
Compare
Contributor
Author
|
the link checker failure is unrelated: |
reta
reviewed
Jun 23, 2025
reta
reviewed
Jun 23, 2025
java-client/src/main/java/org/opensearch/client/json/jackson/JacksonJsonpMapper.java
Show resolved
Hide resolved
Collaborator
|
LGTM, one minor comment, thanks @rursprung |
f164c43 to
05a8862
Compare
jackson 2.x still supports java 7 and thus does not automatically support java 8 classes. this will change with jackson 3.x (see e.g. this [PR adding JSR310 date support] to 3.x). PR opensearch-project#251 added documentation on how a custom `ObjectMapper` can be registered - but there's no reason why we can't just enable auto-detection centrally. the docs mention that performance should be considered, but this is IMHO not relevant here since we only construct it once and then keep the same `ObjectMapper` (which in turn the docs mention as best practices). Signed-off-by: Ralph Ursprung <Ralph.Ursprung@avaloq.com> [PR adding JSR310 date support]: FasterXML/jackson-databind#5032
05a8862 to
d0a398e
Compare
reta
approved these changes
Jun 24, 2025
Collaborator
|
@Xtansia no concerns from you? thanks! |
Xtansia
approved these changes
Jun 24, 2025
Collaborator
Xtansia
left a comment
There was a problem hiding this comment.
No concerns from me, thanks @rursprung
opensearch-trigger-bot bot
pushed a commit
that referenced
this pull request
Jun 24, 2025
jackson 2.x still supports java 7 and thus does not automatically support java 8 classes. this will change with jackson 3.x (see e.g. this [PR adding JSR310 date support] to 3.x). PR #251 added documentation on how a custom `ObjectMapper` can be registered - but there's no reason why we can't just enable auto-detection centrally. the docs mention that performance should be considered, but this is IMHO not relevant here since we only construct it once and then keep the same `ObjectMapper` (which in turn the docs mention as best practices). Signed-off-by: Ralph Ursprung <Ralph.Ursprung@avaloq.com> [PR adding JSR310 date support]: FasterXML/jackson-databind#5032 (cherry picked from commit c1ae512) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Xtansia
pushed a commit
that referenced
this pull request
Jun 24, 2025
jackson 2.x still supports java 7 and thus does not automatically support java 8 classes. this will change with jackson 3.x (see e.g. this [PR adding JSR310 date support] to 3.x). PR #251 added documentation on how a custom `ObjectMapper` can be registered - but there's no reason why we can't just enable auto-detection centrally. the docs mention that performance should be considered, but this is IMHO not relevant here since we only construct it once and then keep the same `ObjectMapper` (which in turn the docs mention as best practices). [PR adding JSR310 date support]: FasterXML/jackson-databind#5032 (cherry picked from commit c1ae512) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Contributor
Author
|
thanks everyone! can we backport this to 2.x as well? |
Contributor
|
The backport to To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/opensearch-java/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/opensearch-java/backport-2.x
# Create a new branch
git switch --create backport/backport-1643-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 c1ae512803223204800a860f797f146871131bda
# Push it to GitHub
git push --set-upstream origin backport/backport-1643-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/opensearch-java/backport-2.xThen, create a pull request where the |
Xtansia
pushed a commit
to Xtansia/opensearch-java
that referenced
this pull request
Jun 25, 2025
jackson 2.x still supports java 7 and thus does not automatically support java 8 classes. this will change with jackson 3.x (see e.g. this [PR adding JSR310 date support] to 3.x). PR opensearch-project#251 added documentation on how a custom `ObjectMapper` can be registered - but there's no reason why we can't just enable auto-detection centrally. the docs mention that performance should be considered, but this is IMHO not relevant here since we only construct it once and then keep the same `ObjectMapper` (which in turn the docs mention as best practices). Signed-off-by: Ralph Ursprung <Ralph.Ursprung@avaloq.com> [PR adding JSR310 date support]: FasterXML/jackson-databind#5032 (cherry picked from commit c1ae512) Signed-off-by: Thomas Farr <tsfarr@amazon.com>
reta
pushed a commit
to reta/opensearch-java
that referenced
this pull request
Jun 25, 2025
jackson 2.x still supports java 7 and thus does not automatically support java 8 classes. this will change with jackson 3.x (see e.g. this [PR adding JSR310 date support] to 3.x). PR opensearch-project#251 added documentation on how a custom `ObjectMapper` can be registered - but there's no reason why we can't just enable auto-detection centrally. the docs mention that performance should be considered, but this is IMHO not relevant here since we only construct it once and then keep the same `ObjectMapper` (which in turn the docs mention as best practices). Signed-off-by: Ralph Ursprung <Ralph.Ursprung@avaloq.com> [PR adding JSR310 date support]: FasterXML/jackson-databind#5032 (cherry picked from commit c1ae512)
Xtansia
added a commit
that referenced
this pull request
Jun 25, 2025
jackson 2.x still supports java 7 and thus does not automatically support java 8 classes. this will change with jackson 3.x (see e.g. this [PR adding JSR310 date support] to 3.x). PR #251 added documentation on how a custom `ObjectMapper` can be registered - but there's no reason why we can't just enable auto-detection centrally. the docs mention that performance should be considered, but this is IMHO not relevant here since we only construct it once and then keep the same `ObjectMapper` (which in turn the docs mention as best practices). [PR adding JSR310 date support]: FasterXML/jackson-databind#5032 (cherry picked from commit c1ae512) Signed-off-by: Thomas Farr <tsfarr@amazon.com> Co-authored-by: Ralph Ursprung <39383228+rursprung@users.noreply.github.com>
001mertiya
pushed a commit
to 001mertiya/opensearch-java
that referenced
this pull request
Jul 9, 2025
jackson 2.x still supports java 7 and thus does not automatically support java 8 classes. this will change with jackson 3.x (see e.g. this [PR adding JSR310 date support] to 3.x). PR opensearch-project#251 added documentation on how a custom `ObjectMapper` can be registered - but there's no reason why we can't just enable auto-detection centrally. the docs mention that performance should be considered, but this is IMHO not relevant here since we only construct it once and then keep the same `ObjectMapper` (which in turn the docs mention as best practices). Signed-off-by: Ralph Ursprung <Ralph.Ursprung@avaloq.com> [PR adding JSR310 date support]: FasterXML/jackson-databind#5032 Signed-off-by: psingh3 <pushpendra.singh@walmart.com>
001mertiya
pushed a commit
to 001mertiya/opensearch-java
that referenced
this pull request
Jul 9, 2025
jackson 2.x still supports java 7 and thus does not automatically support java 8 classes. this will change with jackson 3.x (see e.g. this [PR adding JSR310 date support] to 3.x). PR opensearch-project#251 added documentation on how a custom `ObjectMapper` can be registered - but there's no reason why we can't just enable auto-detection centrally. the docs mention that performance should be considered, but this is IMHO not relevant here since we only construct it once and then keep the same `ObjectMapper` (which in turn the docs mention as best practices). Signed-off-by: Ralph Ursprung <Ralph.Ursprung@avaloq.com> [PR adding JSR310 date support]: FasterXML/jackson-databind#5032 Signed-off-by: psingh3 <pushpendra.singh@walmart.com>
001mertiya
pushed a commit
to 001mertiya/opensearch-java
that referenced
this pull request
Jul 9, 2025
jackson 2.x still supports java 7 and thus does not automatically support java 8 classes. this will change with jackson 3.x (see e.g. this [PR adding JSR310 date support] to 3.x). PR opensearch-project#251 added documentation on how a custom `ObjectMapper` can be registered - but there's no reason why we can't just enable auto-detection centrally. the docs mention that performance should be considered, but this is IMHO not relevant here since we only construct it once and then keep the same `ObjectMapper` (which in turn the docs mention as best practices). Signed-off-by: Ralph Ursprung <Ralph.Ursprung@avaloq.com> [PR adding JSR310 date support]: FasterXML/jackson-databind#5032 Signed-off-by: psingh3 <pushpendra.singh@walmart.com>
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.
jackson 2.x still supports java 7 and thus does not automatically support java 8 classes. this will change with jackson 3.x (see e.g. this PR adding JSR310 date support to 3.x).
PR #251 added documentation on how a custom
ObjectMappercan be registered - but there's no reason why we can't just enable auto-detection centrally. the docs mention that performance should be considered, but this is IMHO not relevant here since we only construct it once and then keep the sameObjectMapper(which in turn the docs mention as best practices).Signed-off-by: Ralph Ursprung Ralph.Ursprung@avaloq.com
this is split from #1614. CC @reta & @Xtansia
Description
Describe what this change achieves.
Issues Resolved
List any issues this PR will resolve, e.g. Closes [...].
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.