Anything changed with serialization of enum classe...
# serialization
r
Anything changed with serialization of enum classes in 1.0.0 on Kotlin/JS? I have the following error when I try to serialize enum class without
@Serializable
annotation:
Copy code
SerializationException: Serializer for class 'Test' is not found.
Mark the class as @Serializable or provide the serializer explicitly.
On Kotlin/JS explicitly declared serializer should be used for interfaces and enums without @Serializable annotation
It works when I use
@Serializable
, but the documentation states enum do not need this annotation: https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/builtin-classes.md#enum-classes
s
They do not need it when used inside objects. For top-level enums it's better to use
@Serializable
r
Thx for the clarification.