Is the JSON serializer deterministic? i.e. if two input data classes are equal, will it always produce the same output, regardless of where and when? I think we can assume the same version of kotlinx-serialization is always used.
d
Dominaezzz
04/21/2021, 6:57 PM
The same compiled binary, yes. Stability issue would come from the Kotlin compiler as it does not guarantee field order iirc.
Kotlin serialization guarantees the same field order as in the program. The differences may come only between different versions of libs, if serialization format has a leeway in how things can be encoded.
👍 1
elizarov
04/22/2021, 7:19 AM
However, the underlying data may be non-deterministic. E.g. a