-
-
Notifications
You must be signed in to change notification settings - Fork 587
[HV-2161] Rework documentation example for Jackson 3 #1776
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Thanks for your pull request! This pull request appears to follow the contribution rules. › This message was automatically generated. |
|
Hi @jobayle 👋🏻 thanks for the PR! It's been a while since that example was introduced 🙂, I'll have a closer look. |
08d53d6 to
5c1a1a8
Compare
|
Hi Marko, The visitor already exists in Jackson 2, and works the same, so code examples should work with both versions. (except there is an extra Exception in Jackson 2, I've added the try/catch so it remains compatible) Unfortunately starting with Jackson3 they've changed packages: So as long as code examples don't mention packages/imports, we're good (Example 12.31 is the only offending example). I've updated the dependency to Jackson3 to be future proof. I've added a commit that reverts to Jackson2 but with the new code to prove it works for both versions! |
|
hey 🙂, thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! 🙂
I went through the changes and added a few suggestions inline.
btw the build failed with formatting checks, you might want to run mvn spotless:apply and apply the changes to the files you've updated.
...ate/validator/referenceguide/chapter12/nodenameprovider/JacksonPropertyNodeNameProvider.java
Outdated
Show resolved
Hide resolved
...ate/validator/referenceguide/chapter12/nodenameprovider/JacksonPropertyNodeNameProvider.java
Outdated
Show resolved
Hide resolved
This use case: https://docs.hibernate.org/stable/validator/reference/en-US/html_single/#section-property-node-name-provider Uses the interpolator, which is an internal component of Jackson that was exposed for testing purposes. In Jackson 3, the interpolator is no longer publicly exposed, a Visitor must be used instead. See discussion here: FasterXML/jackson#330
5c1a1a8 to
dd42908
Compare
This use case:
https://docs.hibernate.org/stable/validator/reference/en-US/html_single/#section-property-node-name-provider
Uses the interpolator, which is an internal component of Jackson that was exposed for testing purposes.
In Jackson 3, the interpolator is no longer publicly exposed, a Visitor must be used instead.
See discussion here:
FasterXML/jackson#330
If this is your first time contributing to the project,
please consider reviewing https://github.com/hibernate/hibernate-validator/blob/main/CONTRIBUTING.md ✅
Please include a link to the Jira issue solved by this PR in the description;
see https://hibernate.atlassian.net/browse/HV ➡️ I cannot create a JIRA issue with my atlassian account
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 licensing, please check here.