When receiving a payload as JsonObject in a HttpClient using kotlinx-serialization, is there a way to make it generate nulls instead of JsonNulls for fields that are present but have a null value? I tried setting explicitNulls to false but that didn't seem to work
a
Aleksei Tirman [JB]
07/19/2023, 9:51 AM
It must not be possible because of the type safety.
m
martmists
07/19/2023, 12:28 PM
so
obj["missingKey"]
can be null just fine but
obj["keyWithNullValue"]
can not be null because somehow that conflicts with type safety?
a
Aleksei Tirman [JB]
07/19/2023, 4:23 PM
Maybe I am wrong, so you'd better ask this question in the #serialization channel.