-
-
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
@JsonFormat.pattern on dates is now ignored if shape is not explicitely provided #1154
Milestone
Comments
Thank you for reporting this. I think you are probably right with your assessment and this was just an oversight. |
yrodiere
added a commit
to yrodiere/jackson-databind
that referenced
this issue
Mar 8, 2016
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 strings when @jsonformat(shape = Shape.ANY) is set on a property.
Merged
yrodiere
added a commit
to yrodiere/jackson-databind
that referenced
this issue
Mar 8, 2016
yrodiere
added a commit
to yrodiere/jackson-databind
that referenced
this issue
Mar 9, 2016
yrodiere
added a commit
to yrodiere/jackson-databind
that referenced
this issue
Mar 9, 2016
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.
cowtowncoder
added a commit
that referenced
this issue
Mar 12, 2016
Fixed for 2.7.3. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Since #1111 was merged,
JsonFormat.pattern
is now only taken into account if the shape is set toSTRING
. When leaving the default shape (ANY
), the pattern is ignored.Thus this works:
But this doesn't (anymore):
From what I understand of DataTimeSerializerBase's code, it seems that the default "shape" for a date-time is a String (see how
_asTimestamp
returns false by default). So it seems that providing a pattern should work with the shapeANY
, which means "the default shape", which isSTRING
.The issue stems from this line . It should be something like this instead:
PR coming as soon as I have the issue ID.
The text was updated successfully, but these errors were encountered: