system-text-json-net11
Imperative guidance for the System.Text.Json APIs added in .NET 11: the built-in `JsonNamingPolicy.PascalCase` naming policy, and the strongly-typed `JsonSerializerOptions.GetTypeInfo<T>()` and `JsonSerializerOptions.TryGetTypeInfo<T>(out JsonTypeInfo<T>? info)` metadata accessors. USE FOR: serializing or deserializing JSON in a net11.0-or-later project when you need PascalCase JSON property names without writing a custom naming policy, a strongly-typed `JsonTypeInfo<T>` instead of the non-generic `JsonTypeInfo`, or a no-throw way to probe whether a type's serialization metadata is resolved. D
npx skills add dotnet/skills --skill system-text-json-net11 --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# System.Text.Json — .NET 11 Three APIs were added to `System.Text.Json` in .NET 11. This skill tells you exactly when to reach for each one, what to write, what **not** to write, and how to prove the result runs. Do not describe these APIs to the user — apply them, then run the code and show the output. | API | Replaces the pre-.NET-11 workaround of... | | --- | --- | | `JsonNamingPolicy.PascalCase` (static property) | writing a custom `JsonNamingPolicy` subclass or hand-annotating every member with `[JsonPropertyName]` | | `JsonSerializerOptions.GetTypeInfo<T>()` | calling non-generic `GetTypeInfo(typeof(T))` and casting to `JsonTypeInfo<T>` | | `JsonSerializerOptions.TryGetTypeInfo<T>(out JsonTypeInfo<T>? info)` | wrapping `GetTypeInfo` in `try`/`catch` to probe availability | ## Step 0 — Confirm you can target .NET 11 These APIs only exist in the .NET 11 base class library. Before writing code: 1. Run `dotnet --list-sdks` and confirm an SDK that can target `net11.0` is present — an `11.x` SDK, or any later SDK (`12.x`+) that has the `net11.0` targeting pack installed. 2. If no such SDK is available, **stop**: tell the user these APIs require targeting `net11.0` (on the .NET 11
- Step 0 — Confirm you can target .NET 11
- Decision table — symptom → do this → never do this
- Rule 1 — PascalCase property names
- Rule 2 — Strongly-typed JsonTypeInfo<T>
- Rule 3 — Probe metadata without throwing
- Producing runnable output on net11.0
- Option A — console project (recommended)
- Option B — file-based app (quickest, one caveat)
- Worked example — serialize with typed metadata + PascalCase
- Validation checklist
- Common pitfalls
- More info
What does the system-text-json-net11 skill do?
Imperative guidance for the System.Text.Json APIs added in .NET 11: the built-in `JsonNamingPolicy.PascalCase` naming policy, and the strongly-typed `JsonSerializerOptions.GetTypeInfo<T>()` and `JsonSerializerOptions.TryGetTypeInfo<T>(out JsonTypeInfo<T>? info)` metadata accessors. USE FOR: serializing or deserializing JSON in a net11.0-or-later project when you need PascalCase JSON property names without writing a custom naming policy, a strongly-typed `JsonTypeInfo<T>` instead of the non-generic `JsonTypeInfo`, or a no-throw way to probe whether a type's serialization metadata is resolved. D
How do I install it?
Run `npx skills add dotnet/skills --skill system-text-json-net11 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From dotnet/skills, a repository with 4,927 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
