if anybody else is using `KClass.serializer()` it’...
# serialization
e
if anybody else is using
KClass.serializer()
it’s marked as
@InternalSerializationApi
in 1.0.0-RC, I filed https://github.com/Kotlin/kotlinx.serialization/issues/991 to try and get some more clarity on why it’s not recommended
e
It is not feature-full and fails to work correctly in some cases.
e
would love more detail on what cases it doesn’t work for
e
@sandwwraith can elaborate. However, it does not really matter what are its current limitations. They will definitely be changing from version to version. The key question here is why you need it?
e
sorry for delay, it’s late here. my usecase is laid out in the ticket (link to the github file
OneOfSerializer
). i have a sealed class that represents a protobuf “oneof” where only one of the field names is set in the json, so i have a custom serializer for this case and use
nestedClasses
to get the implementations of the sealed class. then serializer checks for the fieldnames corresponding to the implementations
v
https://github.com/Kotlin/kotlinx.serialization/issues/991#issuecomment-676098265 I’ve answered in the issue, let’s move our discussion there
👍 1