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

ZonedDateTime serialization with @JsonFormat pattern never uses it while WRITE_DATES_WITH_ZONE_ID enabled #4829

Closed
1 task done
verve111 opened this issue Dec 4, 2024 · 3 comments
Labels
to-evaluate Issue that has been received but not yet evaluated

Comments

@verve111
Copy link

verve111 commented Dec 4, 2024

Search before asking

  • I searched in the issues and found nothing similar.

Describe the bug

Hi, I'm using JavaTimeModule() in my app with SerializationFeature.WRITE_DATES_WITH_ZONE_ID enabled and there's a strange thing:
When JsonFormat-annotation with pattern is added:

    static class SomeDto {
        @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss z")
        private ZonedDateTime time;
    }

Current object is always serialized as an ISO_ZONED_DATE_TIME, e.g. "2024-11-15T18:27:06.921054+01:00[Europe/Germany]", the pattern is not taken into account.
Could you give a hint if this is expected behaviour, thanks you!

Version Information

2.18.1

Expected behavior

{"time":"2024-12-02 16:30:00 CET"}

@verve111 verve111 added the to-evaluate Issue that has been received but not yet evaluated label Dec 4, 2024
@pjfanning
Copy link
Member

pjfanning commented Dec 4, 2024

can you close this and open it in the right repo? https://github.com/FasterXML/jackson-modules-java8

can you also try to reproduce the issue using pure Java? If the issue is a Kotlin only issue, it should be reported to the jackson-module-kotlin project.

@pjfanning
Copy link
Member

@verve111 this seems a bit like FasterXML/jackson-modules-java8#330

@verve111
Copy link
Author

verve111 commented Dec 4, 2024

close the issue since moving to FasterXML/jackson-modules-java8#333

@verve111 verve111 closed this as completed Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
to-evaluate Issue that has been received but not yet evaluated
Projects
None yet
Development

No branches or pull requests

2 participants