Skip to content

Commit ed74092

Browse files
authored
Clarify what missing members article is about (#44400)
1 parent e10e4eb commit ed74092

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

docs/core/whats-new/dotnet-8/runtime.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ Required modifier for first parameter: System.Runtime.InteropServices.InAttribut
170170

171171
### Serialization
172172

173-
Many improvements have been made to <xref:System.Text.Json?displayProperty=fullName> serialization and deserialization functionality in .NET 8. For example, you can [customize handling of members that aren't in the JSON payload](../../../standard/serialization/system-text-json/missing-members.md).
173+
Many improvements have been made to <xref:System.Text.Json?displayProperty=fullName> serialization and deserialization functionality in .NET 8. For example, you can [customize handling of JSON properties that aren't in the POCO](../../../standard/serialization/system-text-json/missing-members.md).
174174

175175
The following sections describe other serialization improvements:
176176

docs/fundamentals/toc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ items:
745745
href: ../standard/serialization/system-text-json/nullable-annotations.md
746746
- name: Allow invalid JSON
747747
href: ../standard/serialization/system-text-json/invalid-json.md
748-
- name: Handle missing members
748+
- name: Handle unmapped members
749749
href: ../standard/serialization/system-text-json/missing-members.md
750750
- name: Handle overflow JSON, use JsonElement or JsonNode
751751
href: ../standard/serialization/system-text-json/handle-overflow.md

docs/standard/serialization/system-text-json/missing-members.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
---
2-
title: Handle missing members during deserialization
2+
title: Handle unmapped members during deserialization
33
description: "Learn how to configure the JSON deserialization behavior when properties are present in the JSON payload that aren't present in the POCO type."
4-
ms.date: 03/01/2023
4+
ms.date: 01/15/2025
55
no-loc: [System.Text.Json]
66
dev_langs:
77
- "csharp"
88
---
99

10-
# Handle missing members during deserialization
10+
# Handle unmapped members during deserialization
1111

12-
By default, if the JSON payload you're deserializing contains properties that don't exist in the deserialized plain old CLR object (POCO) type, they're simply ignored. Starting in .NET 8, you can specify that all members must be present in the payload. If they're not, a <xref:System.Text.Json.JsonException> exception is thrown. You can configure this behavior in one of three ways:
12+
By default, if the JSON payload you're deserializing contains properties that don't exist in the plain old CLR object (POCO) type, they're simply ignored. Starting in .NET 8, you can specify that *all payload properties must exist in the POCO*. If they're not, a <xref:System.Text.Json.JsonException> exception is thrown during deserialization. You can configure this behavior in one of three ways:
1313

14-
- Annotate your POCO type with the <xref:System.Text.Json.Serialization.JsonUnmappedMemberHandlingAttribute> attribute, specifying either to <xref:System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip> or <xref:System.Text.Json.Serialization.JsonUnmappedMemberHandling.Disallow> missing members.
14+
- Annotate your POCO type with the <xref:System.Text.Json.Serialization.JsonUnmappedMemberHandlingAttribute> attribute, specifying either to <xref:System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip> or <xref:System.Text.Json.Serialization.JsonUnmappedMemberHandling.Disallow> unmapped members.
1515

1616
```csharp
1717
[JsonUnmappedMemberHandling(JsonUnmappedMemberHandling.Disallow)]

0 commit comments

Comments
 (0)