@JsonFormat does not work with Graalvm + quarkus-resteasy-reactive-jackson
See original GitHub issueDescribe the bug
I have a data class with a OffsetDateTime.
data class MyData( @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ssZ", timezone = "UTC") val myTime: OffsetDateTime)
When running under Java the serialization works, in native mode it doesn’t.
Expected behavior
{ "myTime": "2021-03-10T19:15:00+0000" }
Actual behavior
{ "myTime": 1615403700.000000000 }
Environment (please complete the following information):
- GraalVM version: 21.0.0
- Quarkus version or git rev: 1.12.2.Final
- Build tool (ie. output of
mvnw --version
orgradlew --version
): Gradle 6.6.1
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Native image doesn't respect date format with @JsonFormat
Update: I made mi own serializer and still doesn't work. I added one log to see if it goes through that class. When...
Read more >Assisted Configuration with Tracing Agent - GraalVM
The generated files are standalone configuration files in JSON format which contain all intercepted dynamic accesses. It can be necessary to run the...
Read more >JsonFormat (jackson) not working when no explicity @Body ...
When trying to use @Body annotation we can't use @RequestBean due to the bean is replaced with a new instance to fill body...
Read more >Native Image Build Configuration - Oracle Help Center
The generated files are standalone configuration files in JSON format which contain all intercepted dynamic accesses. It can be necessary to run the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Currently there is no Kotlin in those guides, but if we do add Kotlin examples at some point, we will certainly consider this.
There is nothing Quarkus can do about this. It has to do with the bytecode Kotlin produces and how Jackson handles the annotation lookups
Maybe here? https://quarkus.io/guides/rest-json#jackson .
But I still think this is a bug. Isn’t it possible to get it to work? We are using the annotation in multiple quarkus and spring projects and it works everywhere without the the field specifier.