This is so much better! Thank you! Let me propose Kotlin serialization team to include this example into official “Kotlin serialization guide” in the section that covers Builtin collection serializers. I believe my case of ordered serialization of Set’s is quite common.