How to deserialize ThreeTen LocalDateTime in Retrofit?
<p>I'm trying to deserialise this class in Retrofit:</p>

<pre><code>data class Measurement(val id: Long, val value: Float, val dateTime: LocalDateTime, val trashCanId: Long) : Parcelable {
    companion object {
        @JvmField val CREATOR: Parcelable.Creator&lt;Measurement&gt; = object : Parcelable.Creator&lt;Measurement&gt; {
            override fun createFromParcel(source: Parcel): Measurement = Measurement(source)
            override fun newArray(size: Int): Array&lt;Measurement?&gt; = arrayOfNulls(size)
        }
    }

    constructor(source: Parcel) : this(source.readLong(), source.readFloat(), source.readSerializable() as LocalDateTime, source.readLong())

    override fun describeContents() = 0

    override fun writeToParcel(dest: Parcel?, flags: Int) {
        dest?.writeLong(id)
        dest?.writeFloat(value)
        dest?.writeSerializable(dateTime)
        dest?.writeLong(trashCanId)
    }

}
</code></pre>

<p>As you can see, I'm using LocalDateTime, it's from ThreeTen. Well, I receive this from my server</p>

<pre><code>    {
        "id": 1,
        "value": 50.6,
        "dateTime": {
          "hour": 2,
          "minute": 6,
          "second": 9,
          "nano": 0,
          "dayOfYear": 308,
          "dayOfWeek": "THURSDAY",
          "month": "NOVEMBER",
          "dayOfMonth": 3,
          "year": 2016,
          "monthValue": 11,
          "chronology": {
            "id": "ISO",
            "calendarType": "iso8601"
          }
        }
      }
</code></pre>

<p>Well, but my dateTime is always <em>Null</em> so I believe that Retrofit doesnt know how parse the Data, or am I missing something?</p>

<p>Is there any good workaround? </p>

<p>Any help is appreciated!</p>