Join Slack
Powered by
I'm experimenting with writing my own serializatio...
# serialization
d
diesieben07
10/13/2020, 4:09 PM
I'm experimenting with writing my own serialization format. How would I best handle it, if the underlying format can handle certain types (like for example a Timestamp) natively? Would I detect this type in
Encoder#encodeSerializableValue
and act accordingly?
r
russhwolf
10/14/2020, 12:56 AM
There's a good breakdown of custom serialization formats in the docs here
https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/formats.md#custom-formats-experimental
👍 1
d
diesieben07
10/14/2020, 8:21 AM
Thank you, that seems to confirm my idea.
s
sandwwraith
10/15/2020, 6:40 PM
Yes, this is a recommended approach:
https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/formats.md#format-specific-types
2
Views
Open in Slack
Previous
Next