Skip to content

Conversation

@tdykstra
Copy link
Contributor

Copy link
Contributor

@gewarren gewarren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should you also add a remark in the remarks section that it does not apply to deserialization?

@opbld31
Copy link

opbld31 commented Mar 24, 2021

Docs Build status updates of commit f8fe2b0:

✅ Validation status: passed

File Status Preview URL Details
xml/System.Text.Json/JsonSerializerOptions.xml ✅Succeeded View

For more details, please refer to the build report.

Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.

For any questions, please:

@tdykstra
Copy link
Contributor Author

@gewarren Thanks for the review!

@opbld31
Copy link

opbld31 commented Mar 24, 2021

Docs Build status updates of commit 54626e7:

✅ Validation status: passed

File Status Preview URL Details
xml/System.Text.Json/JsonSerializerOptions.xml ✅Succeeded View

For more details, please refer to the build report.

Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.

For any questions, please:

@tdykstra tdykstra merged commit efedb2e into main Mar 24, 2021
@tdykstra tdykstra deleted the tdykstra-patch-1 branch March 24, 2021 21:12
@layomia
Copy link
Contributor

layomia commented Mar 25, 2021

Actually, IgnoreNullValues is honored when deserializing. We did this for compat with Newtonsoft.Json (NullValueHandling) in v1 (.NET Core 3.x), but ended up obsoleting it after introducing DefaultIgnoreCondition in .NET 5.

DefaultIgnoreCondition (currently) only applies to serialization. When designing the new option, we couldn't think of a good reason to ignore null values in JSON payloads when reading. Most Newtonsoft.Json users don't even know that NullValueHandling is honored when deserializing. We decided not to carry over the "mistake" we made with IgnoreNullValues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ignoring nulls doesn't seem to work during deserialization

5 participants