I have a Java EE project that uses JOOQ to auto generate records using Kotin.
One such record is:
@Suppress("UNCHECKED_CAST")
open class EmailAddressRecord() : UpdatableRecordImpl<EmailAddressRecord>(EmailAddress.EMAIL_ADDRESS),
Record5<Int?, Int?, String?, Boolean?, Boolean?> {
//...
var isInList: Boolean?
set(value) = set(3, value)
get() = get(3) as Boolean?
When sent to the client via a GET
method, the record is serialized into a json like { "isInList": true }
as expected.
But if I send that back to a PUT
method, I get an error about isInList
not being recognized. If instead I send a json with an inList
property (without the is
), the record is deserialized correctly on the server side.
There are several bits involved so I'm not even sure which is causing the issue:
- Maybe it's because of how JOOQ generates the records with a
var
- Maybe it's Wildfly / RestEasy doing some funky stuff
- Maybe it's Jackson not deserialising the record properly (I have tried to add the jackson kotlin module but it doesn't seem to make any difference)
Any pointers would be appreciated.
Versions: jackson 2.12.2, kotlin 1.4.10, widlfly 10, jooq 3.14.10