2

Is there a way to ignore null values when stringify? Currently it renders as:

"field":null

it would be great if there is a way that null fields are not rendered at all - but I did not find such an option. Anyone knows how this can work?

ligi
  • 39,001
  • 44
  • 144
  • 244
  • 1
    What you are looking for is against the standard. You have an object with a variety of elements, including one named "field" (as in your example). In some cases, it just happens that this specific element was not assigned any value and hence it is `null`. This does **NOT** mean that the element had been removed from the object. – FDavidov May 02 '18 at 11:15

1 Answers1

1

Currently it's not possible, but you may want to keep track of this issue: https://github.com/Kotlin/kotlinx.serialization/issues/58

jivimberg
  • 840
  • 1
  • 10
  • 21