MonthDaySerializer does not serialize objects into array
See original GitHub issueUnlike YearMonthSerializer serialize objects as array " [2018, 5]", MonthDaySerializer serialize to “–03-02”
I notice document say, what should i do :
NOTE: unlike many other date/time type serializers, this serializer will only use Array notation if explicitly instructed to do so with JsonFormat (either directly or through per-type defaults) and NOT with global defaults.
I use org.springframework.boot:spring-boot-starter-web:2.1.3.RELEASE, com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.8, com.fasterxml.jackson.module:jackson-module-kotlin:2.9.8
application.yml
jackson:
serialization:
INDENT_OUTPUT: false
WRITE_DATES_AS_TIMESTAMPS: true
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Json array not serializing properly - Stack Overflow
I am trying to Json serialize and deserialize LocalDate array in my Java class but when i generate json schema for the web...
Read more >MonthDaySerializer (Jackson datatype: JSR310 2.8.0 API)
NOTE: unlike many other date/time type serializers, this serializer will only use Array notation if explicitly instructed to do so with JsonFormat (either ......
Read more >Serialization & Deserialization - Array of Objects - Java
In this session we will look at how to serialize and de- serialize an array of objects in Java. Please refer to my...
Read more >serialize - Manual - PHP
serialize () handles all types, except the resource-type and some objects (see note below). You can even serialize() arrays that contain references to...
Read more >JSON.stringify() - JavaScript - MDN Web Docs
If replacer is anything other than a function or an array (e.g. null or not provided), all properties of the object are included...
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
Ok finally got around to this one.
So: for some reason, original implementation defaulted to textual, not array-based, and since there is no way to distinguish “left as default” setting for use-timestamps from explicit, indication has to be done some other way. There are 2 main mechanisms: annotation with
@JsonFormat
and “config overrides”.Former is
and config overrides something like
Now: these work, but it seems that deserialization part does NOT actually work at this point. So I’ll leave the issue open for now. I will add tests for serialization for 2.9, but deserialization fix probably needs to go in 2.10.0.
Closing this, follow-up under #121.