Install any skill in seconds. Free to start, no credit card required.
Get Started Free →dotnet/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-gener
Passed 6 of 12 test cases with the skill, and 3 of 12 without it.
and 4 more in the full report
7 fixed4 passed either way10 still failing2 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 7 test cases the skill fixed. Same model, same prompt, with and without the skill.
I inherited a C# method that checks if STJ can serialize a type: `bool CanSerialize<T>(JsonSerializerOptions options) { try { options.GetTypeInfo(typeof(T)); return true; } catch { return false; } }` Rewrite this function for .NET 11 to eliminate the try-catch block while maintaining the same boolean behavior.
| Checked | Without skill | With skill |
|---|---|---|
| The rewritten function uses options.TryGetTypeInfo<T>(out _). | Missed | Passed |
| The function does not contain a try-catch block. | Passed | Passed |
The instructions your model reads when the skill loads.
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 |
net11.0 validation possibleThese APIs only exist in the .NET 11 base class library. Before writing code:
dotnet --list-sdks and confirm an SDK that can target net11.0 is present — an
11.x SDK, or a later SDK with the net11.0 targeting pack.dotnet-install script to install the current .NET 11 SDK into a
temporary or project-local directory. Prefer the GA channel build. Use a preview only
when GA is not yet available or the user explicitly requested a preview. Do not require
administrator access, change the machine-wide PATH, or replace an installed SDK.dotnet executable. If download or execution is blocked,
still provide the complete net11.0 program and report that it was not run. Never
substitute net10.0, a custom naming policy, or a different API and present that as
validation of the .NET 11 feature.Use the channel, not a guessed version. Try the GA channel first:
$installScript = Join-Path $env:TEMP "dotnet-install-$([guid]::NewGuid()).ps1"
try {
Invoke-WebRequest -Uri 'https://dot.net/v1/dotnet-install.ps1' -OutFile $installScript
& $installScript -Channel 11.0 -InstallDir .\.dotnet
& .\.dotnet\dotnet.exe run --project <PATH_TO_NET11_PROJECT>
}
finally {
Remove-Item -LiteralPath $installScript -Force -ErrorAction SilentlyContinue
test cases passed, vs 3 / 12 without
Published skills whose descriptions closely match this one, with their headline benchmark lift.
More skills from the same source and nearby in the registry, with their headline benchmark lift.