Hello, ```const val START_ACTION = "start" enum c...
# serialization
k
Hello,
Copy code
const val START_ACTION = "start"
enum class Actions(val info: String) {
    START(START_ACTION)
}
---------------------------------------------------------------------------
@Serializable
data class ActionRequest(
    @SerialName("action_type")
    val actionType: Actions  ----> enum is compulsory to use here
)
---------------------------------------------------------------------------
val actionRequest = ActionRequest(actionType = START)
---------------------------------------------------------------------------```
Here, I am getting output is "START" rather than "start". Can someone please help me with how to get the value of action here?
Fixed ^^
p
To prevent a DenverCoder9 scenario - you need to
@SerialName
annotate the enum instances
😆 2
👍 2