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

Add flag to decodeFromMap to allow implicit nulls #1824

Open
mkotsbak opened this issue Jan 11, 2022 · 0 comments
Open

Add flag to decodeFromMap to allow implicit nulls #1824

mkotsbak opened this issue Jan 11, 2022 · 0 comments
Labels

Comments

@mkotsbak
Copy link

What is your use-case and why do you need this feature?
Similar to explicitNulls for Json: https://kotlin.github.io/kotlinx.serialization/kotlinx-serialization-json/kotlinx-serialization-json/kotlinx.serialization.json/-json-configuration/index.html#kotlinx.serialization.json%2FJsonConfiguration%2FexplicitNulls%2F%23%2FPointingToDeclaration%2F

Describe the solution you'd like

inline fun <T> Properties.decodeFromMap(map: Map<String, Any>, explicitNulls: Boolean = true): T

where it is possible to set explicitNulls to false to allow missing values in map to be acceptable for nullable fields, they will be set to null.

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

1 participant