write java.time.localDate
See original GitHub issueHello,
java.time.* types seems to be supported so i have a case class like this for testing:
case class Created(
localDate:LocalDate=LocalDate.now,
localDateTime: LocalDateTime=LocalDateTime.now,
time:LocalTime=LocalTime.now
)
object Created {
implicit val codec: JsonValueCodec[Created] = JsonCodecMaker.make[Created](CodecMakerConfig(skipUnexpectedFields = false))
}
Here is the result of writeToArray :
{"localDateTime":"2018-10-04T11:42:16.849","time":"11:42:16.849"}
I don’t understand why localDate field is skipped even with skipUnexpectedFields = false.
I have another question about date pattern.
Can we custom the output pattern of localDate & localDateTime ?
Thanks
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
LocalDate (Java Platform SE 8 ) - Oracle Help Center
LocalDate is an immutable date-time object that represents a date, often viewed as year-month-day. Other date fields, such as day-of-year, day-of-week and week- ......
Read more >java.time.LocalDate Class in Java - GeeksforGeeks
LocalDate, It is a class that represents a date. ; DateTimeFormatter, It is a class used to format and parse date and time....
Read more >Java 8 Date - LocalDate, LocalDateTime, Instant - DigitalOcean
LocalDate is an immutable class that represents Date with default format of yyyy-MM-dd. We can use now() method to get the current date....
Read more >Creating a LocalDate with Values in Java | Baeldung
In this tutorial, we'll see how it makes a huge difference. The LocalDate class from the java. time package helps us achieve this....
Read more >Guide to Java LocalDate - HowToDoInJava
The java.time.LocalDate class, introduced in Java 8, represents a local date without time and zone information e.g. ' 2019-03-27 ' ...
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
I have added the transientDefault flag for the CodecMakerConfig to allow turning off skipping of serialization of field values which matched with defaults: https://github.com/plokhotnyuk/jsoniter-scala/commit/f38e48b102f74330bb2b3ae736d546734e34be23
Thanks a lot !