Below are the key data classes that represent the models:
Copy code
data class BatteryInfo(
val id: Int,
val timestamp: LocalDateTime,
val channel: Int,
val battery: Battery,
val site: Int
)
data class BatteryInfoResult(val total: Int, val batteryInfoList: Array<BatteryInfo>)
napperley
04/29/2019, 10:40 PM
Already have the JavaTime module registered in the ObjectMapper, which makes the error all the more puzzling.
napperley
04/29/2019, 11:26 PM
Looks as though I might need to create a custom deserializer for java.time.LocalDateTime. How do I create a custom deserializer that can deserialize a JSON object to a Kotlin object?
napperley
04/29/2019, 11:27 PM
Seems that the JavaTime module is expecting a array and not a object. Isn't there only one way a LocalDateTime instance can be serialized using Jackson?
napperley
05/02/2019, 6:49 AM
Implemented a data class (Timestamp) to act as a workaround that captures some of the JSON properties:
Copy code
@JsonIgnoreProperties(ignoreUnknown = true)
data class Timestamp(
@JsonProperty("year")
val year: Int,
@JsonProperty("monthValue")
val month: Int,
@JsonProperty("dayOfMonth")
val day: Int,
@JsonProperty("hour")
val hour: Int,
@JsonProperty("minute")
val minute: Int
)