so with 0.9.0 i cannot longer just rely on implici...
# serialization
n
so with 0.9.0 i cannot longer just rely on implicit reflection and use
JSON.stringify(something)
for now i solved it like this
Copy code
data class Something(
    val someProperty: String
) {
    @Serializer(forClass=Something::class)
    companion object
}

JSON.parse(Something, string)
is there a better way than adding companion objects to everything ?
s
Is
JSON.parse(Something.serializer(), string)
working for you? Underlying mechanisms for implicit serializers were not changed, experimental annotation was added to emphasise consequences of theirs usage
n
yes it works but then i have to annotate the method, then all methods using that and eventuallz i might as well enable it globally and get no benefit from the annotation
s
you can use non-propagating annotation
@UseExperimental
n
what i'd like to see is that
@Serializable
automaticallz adds Serializer to the companion object if it does not exist
s
Yes, it does.
@Serializable
adds a companion object and function
.serializer()
on it to retrieve serializer
n
nice to know.. i already converted all my code to not use ImplicitReflection
ohh i see now