-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
5.0 updates to System.Text.Json docs #21108
Conversation
Close/reopen to see if snippets system can download the latest .net rc or not... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know it's a WIP, but was reading through anyway.
docs/standard/serialization/system-text-json-converters-how-to.md
Outdated
Show resolved
Hide resolved
docs/standard/serialization/system-text-json-converters-how-to.md
Outdated
Show resolved
Hide resolved
docs/standard/serialization/system-text-json-converters-how-to.md
Outdated
Show resolved
Hide resolved
...ndard/serialization/snippets/system-text-json-how-to-5-0/csharp/CustomConverterHandleNull.cs
Show resolved
Hide resolved
...ndard/serialization/snippets/system-text-json-how-to-5-0/csharp/CustomConverterHandleNull.cs
Outdated
Show resolved
Hide resolved
docs/standard/serialization/snippets/system-text-json-how-to-5-0/csharp/Fields.cs
Show resolved
Hide resolved
docs/standard/serialization/system-text-json-migrate-from-newtonsoft-how-to.md
Outdated
Show resolved
Hide resolved
docs/standard/serialization/system-text-json-migrate-from-newtonsoft-how-to.md
Outdated
Show resolved
Hide resolved
docs/standard/serialization/system-text-json-migrate-from-newtonsoft-how-to.md
Outdated
Show resolved
Hide resolved
docs/standard/serialization/system-text-json-migrate-from-newtonsoft-how-to.md
Outdated
Show resolved
Hide resolved
docs/standard/serialization/system-text-json-migrate-from-newtonsoft-how-to.md
Outdated
Show resolved
Hide resolved
docs/standard/serialization/system-text-json-migrate-from-newtonsoft-how-to.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great. LGTM after these comments are addressed.
docs/standard/serialization/system-text-json-converters-how-to.md
Outdated
Show resolved
Hide resolved
docs/standard/serialization/system-text-json-converters-how-to.md
Outdated
Show resolved
Hide resolved
docs/standard/serialization/system-text-json-converters-how-to.md
Outdated
Show resolved
Hide resolved
docs/standard/serialization/system-text-json-converters-how-to.md
Outdated
Show resolved
Hide resolved
docs/standard/serialization/system-text-json-converters-how-to.md
Outdated
Show resolved
Hide resolved
docs/standard/serialization/system-text-json-migrate-from-newtonsoft-how-to.md
Outdated
Show resolved
Hide resolved
docs/standard/serialization/system-text-json-migrate-from-newtonsoft-how-to.md
Outdated
Show resolved
Hide resolved
docs/standard/serialization/system-text-json-migrate-from-newtonsoft-how-to.md
Outdated
Show resolved
Hide resolved
@@ -246,7 +421,7 @@ To implement type inference for `object` properties, create a converter like the | |||
* `NullValueHandling` is set to `Ignore`, and | |||
* During deserialization, the JSON contains a null value for a non-nullable value type. | |||
|
|||
In the same scenario, <xref:System.Text.Json> does throw an exception. (The corresponding null handling setting is <xref:System.Text.Json.JsonSerializerOptions.IgnoreNullValues?displayProperty=nameWithType>.) | |||
In the same scenario, <xref:System.Text.Json> does throw an exception. (For the corresponding null-handling setting in `System.Text.Json`, see [Conditionally ignore a property](#conditionally-ignore-a-property).) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this link to notes about per-property ignoring or the global setting i.e. DefaultIgnoreCondition.WhenWritingDefault
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the equivalent here is JsonSerializerOptions.IgnoreNullValues, which I removed from the main how-to doc per your comment:
I'm not sure we should advertise this. IgnoreNullValues is obsolete starting in .NET 6.0, and we couldn't think of when it makes sense to ignore a null value received when deserializing.
Fixes #21313
Document new features in 5.0 for System.Text.Json.
There are other outstanding issues for the System.Text.Json docs, this one addresses only the new features for 5.0.
Internal review URL - how-to doc
Internal review URL - migration doc
Internal review URL - custom converters doc