LocalDateTime Serialization


I am trying to return a non-embeddeble object from Service Method exposed as a Rest Service. The object has a field with DataType as LocalDateTime. The entity serialization converts that to below format,

“startDateTime”: {
“date”: {
“year”: 2020,
“month”: 7,
“day”: 17
“time”: {
“hour”: 0,
“minute”: 0,
“second”: 0,
“nano”: 0

Is there any way I can pass my own adapter to Gson serialization config?


Could you provide sources for return type?