Skip to content
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

Serialize of Liste of Date does not follow pattern defined in @JsonFormat #154

Closed
camory opened this issue Jun 3, 2020 · 2 comments · Fixed by #155
Closed

Serialize of Liste of Date does not follow pattern defined in @JsonFormat #154

camory opened this issue Jun 3, 2020 · 2 comments · Fixed by #155
Assignees
Labels

Comments

@camory
Copy link

camory commented Jun 3, 2020

Hello,
I am facing the same issue as described in #141 but with List.
I have a DTO with a List java.util.Date with a custom date format:

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "Europe/Paris")
    private final List<Date> dates;

When serializing, the date format is not taken into account.
It works when replacing the io.vavr.collections.List by java.util.List.

@camory camory changed the title Serialize of Liste of Date does not follow format defined ii YearMonth / LocalDateTime with specific JsonFormat Serialize of Liste of Date does not follow pattern defined in @JsonFormat Jun 3, 2020
@mincong-h
Copy link
Member

Thanks for creating this issue, @camory . I confirm that this is a bug. I'm working on a fix.

@mincong-h
Copy link
Member

@camory , I have a fix for your issue, see #155

However, after the fix, I think you still need to modify your code to make it works. You need to provide the shape:

+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "Europe/Paris")
-    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "Europe/Paris")
     private final List<Date> dates;

@mincong-h mincong-h added this to the v1.0.0-alpha-3 milestone Jul 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants