Open devsvc opened 3 years ago
It can't return map with null
s because encodeToMap
has return type Map<String, Any>
. I believe this was done according to Java's Properties behavior
But it should be indeed fixed: dangling key shouldn't be present in map
My feature request https://github.com/Kotlin/kotlinx.serialization/issues/1823 would probably solve this case.
Any update on this?
Not as far as I know
Describe the bug Properties serializer does not handle map null value correctly. Properties.encodeToMap serialized the key without value. So the map it encoded could not be decoded.
To Reproduce
{m.0=a, m.1=1, m.2=b}
Expected behavior map should be {m.0=a, m.1=1, m.2=b, m.3=null}
if it produce {m.a=1, m.b=null} will be much better
Environment