Skip to content

Add option to not serialize empty collections if configured. #2204

Open
@delopst

Description

@delopst

Hi.

I have a scenario where I want to serialize default values (for example false for boolean), but I want to configure serialization so that empty collections and nulls are not serialized by default.

I can currently achieve the default values are serialized and nulls are removed with the following example:

 val json: Json = Json {
        encodeDefaults = true
        explicitNulls = false
    }

Is it possible also to add an additional property to configure that empty collections will not be serialized?

Regards, Primoz

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions