leandrodev
12/19/2017, 6:16 PMSerialName
to override properties names with custom names. But when attempting to serialize an enum object, I noticed that it doesn't work. Is there any other special annotation for enums?
Another solution that I attempted was to write a custom serializer for my enum class. I've successfully implemented that, but when creating a JSON
with unquoted = true
, I noticed that it does not unquote only the value of my custom serializer. Is this something that implemented the wrong way?
companion object: KSerializer<Status> {
override fun save(output: KOutput, obj: Status) {
output.writeStringValue(obj.description)
}
...
sandwwraith
12/19/2017, 6:55 PM