Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serialize default, but ignore null value. #1360

Closed
elkasvirElka opened this issue Mar 4, 2021 · 4 comments
Closed

Serialize default, but ignore null value. #1360

elkasvirElka opened this issue Mar 4, 2021 · 4 comments
Labels

Comments

@elkasvirElka
Copy link

I have
@serializable
data class A (var taskStatus: String? = null,
var locale: String = "en-US")

I want to deserialize all defaults except null value:
{"locale": "en-US"}

@sandwwraith
Copy link
Member

See also #195

@ArcticLampyrid
Copy link

Providing EncodeDefault annotation per field can be helpful to this situation.
#1091

@ArcticLampyrid
Copy link

I want to deserialize all defaults except null value

Same feature is required in Protobuf to help handle null values by omitting

@qwwdfsad
Copy link
Contributor

qwwdfsad commented Sep 7, 2021

Fixed along with #195

@qwwdfsad qwwdfsad closed this as completed Sep 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants