From 55e1d3ff3463904acdbc7de78a0f860abeba7c7b Mon Sep 17 00:00:00 2001 From: Kartheek Penagamuri Date: Fri, 13 Mar 2026 14:31:14 -0700 Subject: [PATCH 1/7] Update System.Text.Json llms.txt Added detailed information about new features in .NET 10 related to System.Text.Json, best practices in llms.txt file --- .../serialization/system-text-json/llms.txt | 78 ++++++++++++++++++- 1 file changed, 77 insertions(+), 1 deletion(-) diff --git a/docs/standard/serialization/system-text-json/llms.txt b/docs/standard/serialization/system-text-json/llms.txt index 28aa411fd6f8c..98f8c65c49d16 100644 --- a/docs/standard/serialization/system-text-json/llms.txt +++ b/docs/standard/serialization/system-text-json/llms.txt @@ -4,7 +4,83 @@ *Topics available: 31* -**.NET 10 adds:** `JsonSerializerOptions.Strict` preset for best-practice defaults, `AllowDuplicateProperties` option to reject duplicate JSON properties, `PipeReader` deserialization support, and `ReferenceHandler` in `JsonSourceGenerationOptions`. +## What's New in .NET 10 + +### `JsonSerializerOptions.Strict` preset + +A new best-practice defaults preset that enforces stricter serialization and deserialization rules: + +- Applies `JsonUnmappedMemberHandling.Disallow` (rejects unmapped JSON properties) +- Disables `AllowDuplicateProperties` (rejects duplicate JSON keys) +- Preserves case-sensitive property binding +- Enables `RespectNullableAnnotations` and `RespectRequiredConstructorParameters` + +`Strict` is read-compatible with `Default` — an object serialized with `Default` can be deserialized with `Strict`. + +```csharp +// Use the Strict preset for best-practice defaults +var options = new JsonSerializerOptions(JsonSerializerDefaults.Strict); +var result = JsonSerializer.Deserialize(json, options); + +// Or use the singleton +var result = JsonSerializer.Deserialize(json, JsonSerializerOptions.Strict); +``` + +### `AllowDuplicateProperties` option + +Controls whether duplicate JSON properties are allowed during deserialization. Disabled by default in the `Strict` preset. + +```csharp +string json = """{ "Value": 1, "Value": -1 }"""; + +// Default behavior: last value wins +JsonSerializer.Deserialize(json).Value; // -1 + +// Strict behavior: throws JsonException +var options = new JsonSerializerOptions { AllowDuplicateProperties = false }; +JsonSerializer.Deserialize(json, options); // throws JsonException + +// Also works with JsonDocument +var docOptions = new JsonDocumentOptions { AllowDuplicateProperties = false }; +JsonDocument.Parse(json, docOptions); // throws JsonException +``` + +### `PipeReader` deserialization support + +`JsonSerializer.DeserializeAsync()` now supports `System.IO.Pipelines.PipeReader` directly, complementing existing `PipeWriter` support. This eliminates the need to convert a `PipeReader` to a `Stream` before deserializing. + +```csharp +// Before (.NET 9 and earlier) — required Stream conversion +Stream stream = pipeReader.AsStream(); +var result = await JsonSerializer.DeserializeAsync(stream, options); + +// After (.NET 10) — deserialize directly from PipeReader +var result = await JsonSerializer.DeserializeAsync(pipeReader, options); +``` + +### `ReferenceHandler` in `JsonSourceGenerationOptions` + +Source-generated contexts can now specify `ReferenceHandler` to handle circular references and preserve object identity. + +```csharp +[JsonSourceGenerationOptions(ReferenceHandler = JsonKnownReferenceHandler.Preserve)] +[JsonSerializable(typeof(SelfReference))] +internal partial class MyContext : JsonSerializerContext { } + +var selfRef = new SelfReference(); +selfRef.Me = selfRef; +Console.WriteLine(JsonSerializer.Serialize(selfRef, MyContext.Default.SelfReference)); +// Output: {"$id":"1","Me":{"$ref":"1"}} +``` + +## Best Practices + +- **Reuse `JsonSerializerOptions` instances.** Creating a new instance per call is expensive — the metadata cache is rebuilt each time. Use a shared static instance or the built-in singletons (`JsonSerializerOptions.Default`, `.Web`, `.Strict`). +- **Use source generation for AOT/trimming.** Reflection-based serialization is incompatible with Native AOT. Use `[JsonSerializable]` attribute to the context classes for AOT-safe serialization. See the source generation topic below. +- **Prefer `Strict` for new projects.** The `Strict` preset catches common mistakes (unmapped members, duplicate keys, null violations) at deserialization time rather than silently ignoring them. +- **Serialize to UTF-8 when possible.** `SerializeToUtf8Bytes()` is 5–10% faster than string-based serialization because it avoids UTF-16 conversion. + +## Topics - [Serialize and deserialize JSON using C#](https://raw.githubusercontent.com/dotnet/docs/refs/heads/llmstxt/docs/standard/serialization/system-text-json/overview.md): This overview describes the System.Text.Json namespace functionality for serializing to and deserializing from JSON in .NET. - [How to serialize JSON in C#](https://raw.githubusercontent.com/dotnet/docs/refs/heads/llmstxt/docs/standard/serialization/system-text-json/how-to.md): Learn how to use the System.Text.Json namespace to serialize to JSON in .NET. Includes sample code. From a193fda7c79efef4e09488b6881cf4412b7fa07d Mon Sep 17 00:00:00 2001 From: Kartheek Penagamuri Date: Fri, 13 Mar 2026 14:42:37 -0700 Subject: [PATCH 2/7] Revise System.Text.Json documentation Removed detailed sections about `JsonSerializerOptions.Strict`, `AllowDuplicateProperties`, `PipeReader` support, and `ReferenceHandler` from the documentation and added a link to the official doc. --- .../serialization/system-text-json/llms.txt | 69 +------------------ 1 file changed, 1 insertion(+), 68 deletions(-) diff --git a/docs/standard/serialization/system-text-json/llms.txt b/docs/standard/serialization/system-text-json/llms.txt index 98f8c65c49d16..d8ed7c7c09f11 100644 --- a/docs/standard/serialization/system-text-json/llms.txt +++ b/docs/standard/serialization/system-text-json/llms.txt @@ -2,76 +2,9 @@ > High-performance JSON serialization and deserialization for .NET applications. -*Topics available: 31* - ## What's New in .NET 10 -### `JsonSerializerOptions.Strict` preset - -A new best-practice defaults preset that enforces stricter serialization and deserialization rules: - -- Applies `JsonUnmappedMemberHandling.Disallow` (rejects unmapped JSON properties) -- Disables `AllowDuplicateProperties` (rejects duplicate JSON keys) -- Preserves case-sensitive property binding -- Enables `RespectNullableAnnotations` and `RespectRequiredConstructorParameters` - -`Strict` is read-compatible with `Default` — an object serialized with `Default` can be deserialized with `Strict`. - -```csharp -// Use the Strict preset for best-practice defaults -var options = new JsonSerializerOptions(JsonSerializerDefaults.Strict); -var result = JsonSerializer.Deserialize(json, options); - -// Or use the singleton -var result = JsonSerializer.Deserialize(json, JsonSerializerOptions.Strict); -``` - -### `AllowDuplicateProperties` option - -Controls whether duplicate JSON properties are allowed during deserialization. Disabled by default in the `Strict` preset. - -```csharp -string json = """{ "Value": 1, "Value": -1 }"""; - -// Default behavior: last value wins -JsonSerializer.Deserialize(json).Value; // -1 - -// Strict behavior: throws JsonException -var options = new JsonSerializerOptions { AllowDuplicateProperties = false }; -JsonSerializer.Deserialize(json, options); // throws JsonException - -// Also works with JsonDocument -var docOptions = new JsonDocumentOptions { AllowDuplicateProperties = false }; -JsonDocument.Parse(json, docOptions); // throws JsonException -``` - -### `PipeReader` deserialization support - -`JsonSerializer.DeserializeAsync()` now supports `System.IO.Pipelines.PipeReader` directly, complementing existing `PipeWriter` support. This eliminates the need to convert a `PipeReader` to a `Stream` before deserializing. - -```csharp -// Before (.NET 9 and earlier) — required Stream conversion -Stream stream = pipeReader.AsStream(); -var result = await JsonSerializer.DeserializeAsync(stream, options); - -// After (.NET 10) — deserialize directly from PipeReader -var result = await JsonSerializer.DeserializeAsync(pipeReader, options); -``` - -### `ReferenceHandler` in `JsonSourceGenerationOptions` - -Source-generated contexts can now specify `ReferenceHandler` to handle circular references and preserve object identity. - -```csharp -[JsonSourceGenerationOptions(ReferenceHandler = JsonKnownReferenceHandler.Preserve)] -[JsonSerializable(typeof(SelfReference))] -internal partial class MyContext : JsonSerializerContext { } - -var selfRef = new SelfReference(); -selfRef.Me = selfRef; -Console.WriteLine(JsonSerializer.Serialize(selfRef, MyContext.Default.SelfReference)); -// Output: {"$id":"1","Me":{"$ref":"1"}} -``` +`JsonSerializerOptions.Strict` preset for best-practice defaults, `AllowDuplicateProperties` option to reject duplicate JSON properties, `PipeReader` deserialization support, and `ReferenceHandler` in `JsonSourceGenerationOptions`. For more details, see: [.NET 10 Serialization updates](https://github.com/dotnet/docs/blob/main/docs/core/whats-new/dotnet-10/libraries.md#serialization). ## Best Practices From e70a5531163a6d1748bd3a008360cdbf96ff9277 Mon Sep 17 00:00:00 2001 From: Kartheek Penagamuri Date: Fri, 13 Mar 2026 14:50:17 -0700 Subject: [PATCH 3/7] Update llms.txt with .NET 10 JSON serialization features Added new APIs and features introduced in .NET 10 for JSON serialization, including best-practice presets and options for handling duplicate properties. --- docs/standard/serialization/system-text-json/llms.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/standard/serialization/system-text-json/llms.txt b/docs/standard/serialization/system-text-json/llms.txt index d8ed7c7c09f11..c494b9711967e 100644 --- a/docs/standard/serialization/system-text-json/llms.txt +++ b/docs/standard/serialization/system-text-json/llms.txt @@ -4,7 +4,14 @@ ## What's New in .NET 10 -`JsonSerializerOptions.Strict` preset for best-practice defaults, `AllowDuplicateProperties` option to reject duplicate JSON properties, `PipeReader` deserialization support, and `ReferenceHandler` in `JsonSourceGenerationOptions`. For more details, see: [.NET 10 Serialization updates](https://github.com/dotnet/docs/blob/main/docs/core/whats-new/dotnet-10/libraries.md#serialization). +The following APIs were added in .NET 10: + + - `JsonSerializerOptions.Strict` / `JsonSerializerDefaults.Strict` — best-practice preset that disallows unmapped members, duplicate properties, and enforces nullable annotations. + - `JsonSerializerOptions.AllowDuplicateProperties` — option to reject duplicate JSON keys (disabled in Strict). + - `JsonSerializer.DeserializeAsync(PipeReader)` — direct PipeReader deserialization without Stream conversion. + - `JsonSourceGenerationOptionsAttribute.ReferenceHandler` — specify ReferenceHandler in source-generated contexts to handle circular references. + +For full details and code examples, see: [.NET 10 Serialization update](https://github.com/dotnet/docs/blob/main/docs/core/whats-new/dotnet-10/libraries.md#serialization) ## Best Practices From dc10686d3410d35b3b1f8801df2f90fdb6ec5444 Mon Sep 17 00:00:00 2001 From: Kartheek Penagamuri Date: Fri, 13 Mar 2026 14:50:50 -0700 Subject: [PATCH 4/7] Fix formatting in llms.txt for serialization update --- docs/standard/serialization/system-text-json/llms.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/standard/serialization/system-text-json/llms.txt b/docs/standard/serialization/system-text-json/llms.txt index c494b9711967e..bbd9046c1b86f 100644 --- a/docs/standard/serialization/system-text-json/llms.txt +++ b/docs/standard/serialization/system-text-json/llms.txt @@ -11,7 +11,7 @@ The following APIs were added in .NET 10: - `JsonSerializer.DeserializeAsync(PipeReader)` — direct PipeReader deserialization without Stream conversion. - `JsonSourceGenerationOptionsAttribute.ReferenceHandler` — specify ReferenceHandler in source-generated contexts to handle circular references. -For full details and code examples, see: [.NET 10 Serialization update](https://github.com/dotnet/docs/blob/main/docs/core/whats-new/dotnet-10/libraries.md#serialization) +For full details and code examples, see: [.NET 10 Serialization update](https://github.com/dotnet/docs/blob/main/docs/core/whats-new/dotnet-10/libraries.md#serialization). ## Best Practices From ab61ab7b2241acd8321cfd4db373b3a22ef1b3aa Mon Sep 17 00:00:00 2001 From: Kartheek Penagamuri Date: Mon, 16 Mar 2026 13:08:26 -0700 Subject: [PATCH 5/7] Update llms.txt with .NET 10 changes Added new APIs and breaking changes for .NET 10 serialization. --- .../serialization/system-text-json/llms.txt | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/docs/standard/serialization/system-text-json/llms.txt b/docs/standard/serialization/system-text-json/llms.txt index bbd9046c1b86f..d32d1ca50bfc3 100644 --- a/docs/standard/serialization/system-text-json/llms.txt +++ b/docs/standard/serialization/system-text-json/llms.txt @@ -4,15 +4,21 @@ ## What's New in .NET 10 -The following APIs were added in .NET 10: - - - `JsonSerializerOptions.Strict` / `JsonSerializerDefaults.Strict` — best-practice preset that disallows unmapped members, duplicate properties, and enforces nullable annotations. - - `JsonSerializerOptions.AllowDuplicateProperties` — option to reject duplicate JSON keys (disabled in Strict). - - `JsonSerializer.DeserializeAsync(PipeReader)` — direct PipeReader deserialization without Stream conversion. - - `JsonSourceGenerationOptionsAttribute.ReferenceHandler` — specify ReferenceHandler in source-generated contexts to handle circular references. +### New APIs + +- `JsonSerializerOptions.Strict` / `JsonSerializerDefaults.Strict` — best-practice preset that disallows unmapped members, duplicate properties, and enforces nullable annotations. +- `JsonSerializerOptions.AllowDuplicateProperties` — option to reject duplicate JSON keys (disabled in Strict). +- `JsonSerializer.DeserializeAsync(PipeReader)` — direct PipeReader deserialization without Stream conversion. +- `JsonSourceGenerationOptionsAttribute.ReferenceHandler` — specify ReferenceHandler in source-generated contexts to handle circular references. For full details and code examples, see: [.NET 10 Serialization update](https://github.com/dotnet/docs/blob/main/docs/core/whats-new/dotnet-10/libraries.md#serialization). +### Breaking Changes + +- **Property name conflict validation** — System.Text.Json now validates that user-defined property names don't conflict with metadata property names (`$type`, `$id`, `$ref`, or custom `TypeDiscriminatorPropertyName`). Previously, conflicts silently produced invalid JSON with duplicate properties; now an `InvalidOperationException` is thrown. Apply `[JsonIgnore]` on conflicting properties to resolve. + +For details, see: [System.Text.Json checks for property name conflicts](https://github.com/dotnet/docs/blob/main/docs/core/compatibility/serialization/10/property-name-validation.md). + ## Best Practices - **Reuse `JsonSerializerOptions` instances.** Creating a new instance per call is expensive — the metadata cache is rebuilt each time. Use a shared static instance or the built-in singletons (`JsonSerializerOptions.Default`, `.Web`, `.Strict`). From 229cb3410856238d293953957e9d0f24eb620be7 Mon Sep 17 00:00:00 2001 From: Kartheek Penagamuri Date: Mon, 16 Mar 2026 13:13:16 -0700 Subject: [PATCH 6/7] Clarify property name conflict validation message Updated the description of property name conflict validation to suggest renaming conflicting properties. --- docs/standard/serialization/system-text-json/llms.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/standard/serialization/system-text-json/llms.txt b/docs/standard/serialization/system-text-json/llms.txt index d32d1ca50bfc3..65b9b444e92a2 100644 --- a/docs/standard/serialization/system-text-json/llms.txt +++ b/docs/standard/serialization/system-text-json/llms.txt @@ -15,7 +15,7 @@ For full details and code examples, see: [.NET 10 Serialization update](https:// ### Breaking Changes -- **Property name conflict validation** — System.Text.Json now validates that user-defined property names don't conflict with metadata property names (`$type`, `$id`, `$ref`, or custom `TypeDiscriminatorPropertyName`). Previously, conflicts silently produced invalid JSON with duplicate properties; now an `InvalidOperationException` is thrown. Apply `[JsonIgnore]` on conflicting properties to resolve. +- **Property name conflict validation** — System.Text.Json now validates that user-defined property names don't conflict with metadata property names (`$type`, `$id`, `$ref`, or custom `TypeDiscriminatorPropertyName`). Previously, conflicts silently produced invalid JSON with duplicate properties; now an `InvalidOperationException` is thrown. Rename the conflicting property or apply `[JsonIgnore]` to resolve. For details, see: [System.Text.Json checks for property name conflicts](https://github.com/dotnet/docs/blob/main/docs/core/compatibility/serialization/10/property-name-validation.md). From 8847e58fed7a8297d71c0f27f115d29a437698a0 Mon Sep 17 00:00:00 2001 From: Kartheek Penagamuri Date: Thu, 19 Mar 2026 12:30:25 -0700 Subject: [PATCH 7/7] remove topics from the llms.txt Reinstate the note about serializing to UTF-8 for performance benefits. --- .../serialization/system-text-json/llms.txt | 34 ------------------- 1 file changed, 34 deletions(-) diff --git a/docs/standard/serialization/system-text-json/llms.txt b/docs/standard/serialization/system-text-json/llms.txt index 65b9b444e92a2..0b8329dde3814 100644 --- a/docs/standard/serialization/system-text-json/llms.txt +++ b/docs/standard/serialization/system-text-json/llms.txt @@ -25,37 +25,3 @@ For details, see: [System.Text.Json checks for property name conflicts](https:// - **Use source generation for AOT/trimming.** Reflection-based serialization is incompatible with Native AOT. Use `[JsonSerializable]` attribute to the context classes for AOT-safe serialization. See the source generation topic below. - **Prefer `Strict` for new projects.** The `Strict` preset catches common mistakes (unmapped members, duplicate keys, null violations) at deserialization time rather than silently ignoring them. - **Serialize to UTF-8 when possible.** `SerializeToUtf8Bytes()` is 5–10% faster than string-based serialization because it avoids UTF-16 conversion. - -## Topics - -- [Serialize and deserialize JSON using C#](https://raw.githubusercontent.com/dotnet/docs/refs/heads/llmstxt/docs/standard/serialization/system-text-json/overview.md): This overview describes the System.Text.Json namespace functionality for serializing to and deserializing from JSON in .NET. -- [How to serialize JSON in C#](https://raw.githubusercontent.com/dotnet/docs/refs/heads/llmstxt/docs/standard/serialization/system-text-json/how-to.md): Learn how to use the System.Text.Json namespace to serialize to JSON in .NET. Includes sample code. -- [Migrate from Newtonsoft.Json to System.Text.Json](https://raw.githubusercontent.com/dotnet/docs/refs/heads/llmstxt/docs/standard/serialization/system-text-json/migrate-from-newtonsoft.md): Learn about the differences between Newtonsoft.Json and System.Text.Json and how to migrate to System.Text.Json. -- [How to enable case-insensitive property name matching with System.Text.Json](https://raw.githubusercontent.com/dotnet/docs/refs/heads/llmstxt/docs/standard/serialization/system-text-json/character-casing.md): Learn how to enable case-insensitive property name matching while serializing to and deserializing from JSON in .NET. -- [How to customize character encoding with System.Text.Json](https://raw.githubusercontent.com/dotnet/docs/refs/heads/llmstxt/docs/standard/serialization/system-text-json/character-encoding.md): Learn how to customize character encoding while serializing to and deserializing from JSON in .NET. -- [How to instantiate JsonSerializerOptions with System.Text.Json](https://raw.githubusercontent.com/dotnet/docs/refs/heads/llmstxt/docs/standard/serialization/system-text-json/configure-options.md): Learn about constructors for JsonSerializerOptions instances and how to reuse JsonSerializerOptions instances. -- [How to write custom converters for JSON serialization](https://raw.githubusercontent.com/dotnet/docs/refs/heads/llmstxt/docs/standard/serialization/system-text-json/converters-how-to.md): Learn how to create custom converters for the JSON serialization classes that are provided in the System.Text.Json namespace. -- [Custom serialization and deserialization contracts](https://raw.githubusercontent.com/dotnet/docs/refs/heads/llmstxt/docs/standard/serialization/system-text-json/custom-contracts.md): Learn how to write your own contract resolution logic to customize the JSON contract for a type. -- [How to customize property names and values with System.Text.Json](https://raw.githubusercontent.com/dotnet/docs/refs/heads/llmstxt/docs/standard/serialization/system-text-json/customize-properties.md): Learn how to customize property names and values when serializing with System.Text.Json in .NET. -- [How to deserialize JSON in C#](https://raw.githubusercontent.com/dotnet/docs/refs/heads/llmstxt/docs/standard/serialization/system-text-json/deserialization.md): Learn how to use the System.Text.Json namespace to deserialize from JSON in .NET. Includes sample code. -- [JSON schema exporter](https://raw.githubusercontent.com/dotnet/docs/refs/heads/llmstxt/docs/standard/serialization/system-text-json/extract-schema.md): Learn how to use the JsonSchemaExporter class to extract JSON schema documents from .NET types. -- [Include fields in serialization](https://raw.githubusercontent.com/dotnet/docs/refs/heads/llmstxt/docs/standard/serialization/system-text-json/fields.md): Learn how to include fields when you serialize to and deserialize from JSON in .NET. -- [How to handle overflow JSON or use JsonElement or JsonNode in System.Text.Json](https://raw.githubusercontent.com/dotnet/docs/refs/heads/llmstxt/docs/standard/serialization/system-text-json/handle-overflow.md): Learn how to handle overflow JSON or use JsonElement or JsonNode while using System.Text.Json to serialize and deserialize JSON in .NET. -- [Serialization extension methods on HttpClient](https://raw.githubusercontent.com/dotnet/docs/refs/heads/llmstxt/docs/standard/serialization/system-text-json/httpclient-extensions.md): Learn how to serialize and deserialize JSON payloads from the network in a single line of code using extension methods on HttpClient and HttpContent. -- [How to ignore properties with System.Text.Json](https://raw.githubusercontent.com/dotnet/docs/refs/heads/llmstxt/docs/standard/serialization/system-text-json/ignore-properties.md): Learn how to ignore properties when serializing with System.Text.Json in .NET. -- [Use immutable types and properties](https://raw.githubusercontent.com/dotnet/docs/refs/heads/llmstxt/docs/standard/serialization/system-text-json/immutability.md): Learn how to deserialize JSON to immutable types and properties in .NET. -- [How to allow some kinds of invalid JSON with System.Text.Json](https://raw.githubusercontent.com/dotnet/docs/refs/heads/llmstxt/docs/standard/serialization/system-text-json/invalid-json.md): Learn how to allow comments, trailing commas, and quoted numbers while serializing to and deserializing from JSON in .NET. -- [Handle unmapped members during deserialization](https://raw.githubusercontent.com/dotnet/docs/refs/heads/llmstxt/docs/standard/serialization/system-text-json/missing-members.md): Learn how to configure the JSON deserialization behavior when properties are present in the JSON payload that aren't present in the POCO type. -- [Respect nullable annotations](https://raw.githubusercontent.com/dotnet/docs/refs/heads/llmstxt/docs/standard/serialization/system-text-json/nullable-annotations.md): Learn how to configure serialization and deserialization to respect nullable annotations. -- [How to serialize properties of derived classes with System.Text.Json](https://raw.githubusercontent.com/dotnet/docs/refs/heads/llmstxt/docs/standard/serialization/system-text-json/polymorphism.md): Learn how to serialize polymorphic objects while serializing to and deserializing from JSON in .NET. -- [Populate initialized properties](https://raw.githubusercontent.com/dotnet/docs/refs/heads/llmstxt/docs/standard/serialization/system-text-json/populate-properties.md): Learn how to modify properties and fields that are already initialized when deserializing from JSON in .NET. -- [How to preserve references in System.Text.Json](https://raw.githubusercontent.com/dotnet/docs/refs/heads/llmstxt/docs/standard/serialization/system-text-json/preserve-references.md): Learn how to preserve references and handle or ignore circular references while using System.Text.Json to serialize and deserialize JSON in .NET. -- [How to choose reflection or source generation in System.Text.Json](https://raw.githubusercontent.com/dotnet/docs/refs/heads/llmstxt/docs/standard/serialization/system-text-json/reflection-vs-source-generation.md): Learn how to choose reflection or source generation in System.Text.Json. -- [Require properties for deserialization](https://raw.githubusercontent.com/dotnet/docs/refs/heads/llmstxt/docs/standard/serialization/system-text-json/required-properties.md): Learn how to mark properties as required for deserialization to succeed. -- [Source-generation modes in System.Text.Json](https://raw.githubusercontent.com/dotnet/docs/refs/heads/llmstxt/docs/standard/serialization/system-text-json/source-generation-modes.md): Learn about the two different source-generation modes in System.Text.Json. -- [How to use source generation in System.Text.Json](https://raw.githubusercontent.com/dotnet/docs/refs/heads/llmstxt/docs/standard/serialization/system-text-json/source-generation.md): Learn how to use source generation in System.Text.Json. -- [Supported types in System.Text.Json](https://raw.githubusercontent.com/dotnet/docs/refs/heads/llmstxt/docs/standard/serialization/system-text-json/supported-types.md): Learn which types are supported for serialization by the APIs in the System.Text.Json namespace. -- [How to use a JSON DOM in System.Text.Json](https://raw.githubusercontent.com/dotnet/docs/refs/heads/llmstxt/docs/standard/serialization/system-text-json/use-dom.md): Learn how to use a JSON document object model (DOM). -- [How to use Utf8JsonReader in System.Text.Json](https://raw.githubusercontent.com/dotnet/docs/refs/heads/llmstxt/docs/standard/serialization/system-text-json/use-utf8jsonreader.md): Learn how to use Utf8JsonReader. -- [How to use Utf8JsonWriter in System.Text.Json](https://raw.githubusercontent.com/dotnet/docs/refs/heads/llmstxt/docs/standard/serialization/system-text-json/use-utf8jsonwriter.md): Learn how to use Utf8JsonWriter. -- [Visual Basic support for System.Text.Json](https://raw.githubusercontent.com/dotnet/docs/refs/heads/llmstxt/docs/standard/serialization/system-text-json/visual-basic-support.md): Learn which parts of the System.Text.Json namespace aren't supported in Visual Basic.