diff --git a/docs/core/whats-new/dotnet-8/runtime.md b/docs/core/whats-new/dotnet-8/runtime.md index 52aa38c313e49..bb3dcf27e299c 100644 --- a/docs/core/whats-new/dotnet-8/runtime.md +++ b/docs/core/whats-new/dotnet-8/runtime.md @@ -170,7 +170,7 @@ Required modifier for first parameter: System.Runtime.InteropServices.InAttribut ### Serialization -Many improvements have been made to 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). +Many improvements have been made to 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). The following sections describe other serialization improvements: diff --git a/docs/fundamentals/toc.yml b/docs/fundamentals/toc.yml index f3c21c755d52a..15c55f7591d4f 100644 --- a/docs/fundamentals/toc.yml +++ b/docs/fundamentals/toc.yml @@ -743,7 +743,7 @@ items: href: ../standard/serialization/system-text-json/nullable-annotations.md - name: Allow invalid JSON href: ../standard/serialization/system-text-json/invalid-json.md - - name: Handle missing members + - name: Handle unmapped members href: ../standard/serialization/system-text-json/missing-members.md - name: Handle overflow JSON, use JsonElement or JsonNode href: ../standard/serialization/system-text-json/handle-overflow.md diff --git a/docs/standard/serialization/system-text-json/missing-members.md b/docs/standard/serialization/system-text-json/missing-members.md index 3b69e33fdc134..c068cafad4d72 100644 --- a/docs/standard/serialization/system-text-json/missing-members.md +++ b/docs/standard/serialization/system-text-json/missing-members.md @@ -1,17 +1,17 @@ --- -title: Handle missing members during deserialization +title: Handle unmapped members during deserialization 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." -ms.date: 03/01/2023 +ms.date: 01/15/2025 no-loc: [System.Text.Json] dev_langs: - "csharp" --- -# Handle missing members during deserialization +# Handle unmapped members during deserialization -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 exception is thrown. You can configure this behavior in one of three ways: +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 exception is thrown during deserialization. You can configure this behavior in one of three ways: -- Annotate your POCO type with the attribute, specifying either to or missing members. +- Annotate your POCO type with the attribute, specifying either to or unmapped members. ```csharp [JsonUnmappedMemberHandling(JsonUnmappedMemberHandling.Disallow)]