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.
1 year ago
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.