-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Fix for #1154 #1155
Fix for #1154 #1155
Conversation
Looks pretty good, but would it be possible to have a unit test that would fail before fix, pass after? Would be great to have something to guard against regression. I may want to change the logic a little bit, however; if shape is explicitly defined as |
I'll add a test. Regarding the "NUMBER" shape, from what I see it's already handled just a few lines above. |
Partially roll back to pre-FasterXML#1111 behavior. We just make sure that the STRING shape is chosen when Shape.ANY (the default) is set on the annotation, but some other annotation attribute was also set (pattern, locale or timezone). This way of fixing the issue has the added benefit of respecting the user config regarding the default serialization of dates when @jsonformat(shape = Shape.ANY) is set on a property.
Here you go. I took the opportunity to rebase in order to:
|
Excellent! I'll be happy to merge this fix then. One practical thing before merging your first contribution: we need filled Contributor License Agreement (CLA), from: https://github.com/FasterXML/jackson/blob/master/contributor-agreement.pdf It is the only piece of process we require, and once that one-pager is received nothing more is needed for any contributions to Jackson projects. Thank you once again, looking forward to merging this & including in 2.7.3 patch (which should get out within about week). |
Done: I just sent the CLA. |
Thank you again for the contribution! This will be included in 2.7.3. |
Fix for #1154. Partially rolls back to pre-#1111 behavior.
We just make sure that the STRING shape is chosen when Shape.ANY (the default) is set on the annotation, but some other annotation attribute was also set (pattern, locale or timezone).
This way of fixing the issue has the added benefit of respecting the user config regarding the default serialization of
stringsdates when @jsonformat(shape = Shape.ANY) is set on a property.