Skip to content

update llms.txt file for System.Text.Json#52302

Draft
kartheekp-ms wants to merge 6 commits intollmstxtfrom
dev-kmps-update-stj-llms.txt
Draft

update llms.txt file for System.Text.Json#52302
kartheekp-ms wants to merge 6 commits intollmstxtfrom
dev-kmps-update-stj-llms.txt

Conversation

@kartheekp-ms
Copy link
Contributor

No description provided.

Added detailed information about new features in .NET 10 related to System.Text.Json, best practices in llms.txt file
Removed detailed sections about `JsonSerializerOptions.Strict`, `AllowDuplicateProperties`, `PipeReader` support, and `ReferenceHandler` from the documentation and added a link to the official doc.
Added new APIs and features introduced in .NET 10 for JSON serialization, including best-practice presets and options for handling duplicate properties.
- **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

Choose a reason for hiding this comment

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

Do we need all these topics? Would removing all of these reduce token usage for the corresponding evaluation while maintaining accuracy and perf improvements? If not, what's the minimal set?

Copy link
Contributor Author

@kartheekp-ms kartheekp-ms Mar 16, 2026

Choose a reason for hiding this comment

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

It is hard to finalize list of topics without evaluating how Copilot handles related tasks with and without these topics. Maybe we can use learn.microsoft.com metrics and add links to frequently visited topics.

## What's New in .NET 10

**.NET 10 adds:** `JsonSerializerOptions.Strict` preset for best-practice defaults, `AllowDuplicateProperties` option to reject duplicate JSON properties, `PipeReader` deserialization support, and `ReferenceHandler` in `JsonSourceGenerationOptions`.
The following APIs were added in .NET 10:

Choose a reason for hiding this comment

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

Any breaking changes in addition to new APIs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great feedback. I just noticed that there were couple of breaking changes in System.Text.Json as per docs https://learn.microsoft.com/en-us/dotnet/core/compatibility/10#serialization. I will add them to this file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added breaking changes to this file in the latest commit.

Added new APIs and breaking changes for .NET 10 serialization.
Updated the description of property name conflict validation to suggest renaming conflicting properties.
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.

2 participants