kotlinx.serialization icon indicating copy to clipboard operation
kotlinx.serialization copied to clipboard

Provide a public API to instantiate enum serializer

Open qwwdfsad opened this issue 2 years ago • 1 comments

In kotlinx.datetime we need a hand-rolled (because the serialization module is shipped separately) external serializer for enums (e.g. Month).

The problem is that we either have to access internal API (EnumSerializer) or re-implement both EnumSerializer and EnumSerialDescriptor from scratch

qwwdfsad avatar Oct 03 '23 15:10 qwwdfsad

Note that obtaining the serializer via serializer<MyEnum>() is not an option because it does not work on JS and K/N

qwwdfsad avatar Oct 03 '23 16:10 qwwdfsad