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

Stabilize explicitNulls feature: #2661

Merged
merged 3 commits into from
May 14, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: Sergey Shanshin <sergey.shanshin@jetbrains.com>
  • Loading branch information
sandwwraith and shanshin authored May 14, 2024
commit 4542915793598f77c6e8a607edf5f7aec0e64548
6 changes: 3 additions & 3 deletions docs/json.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,10 @@ while nullable properties `version` and `description` are filled with their defa
Project(name=kotlinx.serialization, language=Kotlin, version=1.2.2, website=null, description=null)
```

> Pay attention to the fact that `version` was `null` before encoding and because `1.2.2` after decoding.
> Encoding/decoding of proeprties like it — nullable with non-null default — becomes asymmetrical if `explicitNulls` is set to `false`.
> Pay attention to the fact that `version` was `null` before encoding and became `1.2.2` after decoding.
> Encoding/decoding of properties like this — nullable with a non-null default — becomes asymmetrical if `explicitNulls` is set to `false`.

It is possible to make decoder treat some invalid input data as the missing field to enhance the functionality of this flag.
It is possible to make the decoder treat some invalid input data as a missing field to enhance the functionality of this flag.
See [coerceInputValues](#coercing-input-values) below for details.

`explicitNulls` is `true` by default as it is the default behavior across different versions of the library.
Expand Down