From dotnet11
Provides guidance on new System.Text.Json APIs introduced in .NET 11. It covers typed JsonTypeInfo access via GetTypeInfo<T> and TryGetTypeInfo<T> on JsonSerializerOptions, and the new JsonNamingPolicy.PascalCase static property. Use when serializing or deserializing JSON in .NET 11 applications and needing typed metadata access or PascalCase property naming.
How this skill is triggered — by the user, by Claude, or both
Slash command
/dotnet11:system-text-json-net11The summary Claude sees in its skill listing — used to decide when to auto-load this skill
New APIs added to `System.Text.Json` across .NET 11 releases.
New APIs added to System.Text.Json across .NET 11 releases.
JsonTypeInfo<T> access instead of the untyped JsonTypeInfo overloadTryGetTypeInfo<T>)System.Text.Json (e.g., Newtonsoft.Json)GetTypeInfo(Type) / TryGetTypeInfo(Type, ...) overloads are sufficient<TargetFramework>net11.0</TargetFramework>
JsonTypeInfo AccessJsonSerializerOptions.GetTypeInfo<T>()Returns a strongly-typed JsonTypeInfo<T> for the specified type, using the
options' configured type-info resolver.
JsonTypeInfo<T> GetTypeInfo<T>()
JsonSerializerOptions.TryGetTypeInfo<T>(out JsonTypeInfo<T>?)Attempts to retrieve typed metadata without throwing if the type is not resolved.
bool TryGetTypeInfo<T>(out JsonTypeInfo<T>? typeInfo)
JsonNamingPolicy.PascalCaseA new static property that converts property names to PascalCase during serialization.
static JsonNamingPolicy PascalCase { get; }
using System.Text.Json;
using System.Text.Json.Serialization.Metadata;
var options = new JsonSerializerOptions(JsonSerializerDefaults.Web);
// Retrieve strongly-typed metadata for MyClass
JsonTypeInfo<MyClass> typeInfo = options.GetTypeInfo<MyClass>();
Console.WriteLine($"Type: {typeInfo.Type.Name}");
using System.Text.Json;
using System.Text.Json.Serialization.Metadata;
var options = new JsonSerializerOptions(JsonSerializerDefaults.Web);
if (options.TryGetTypeInfo<MyClass>(out var info))
{
Console.WriteLine($"Resolved type info for {info!.Type.Name}");
}
else
{
Console.WriteLine("Type info not available");
}
using System.Text.Json;
var opts = new JsonSerializerOptions
{
PropertyNamingPolicy = JsonNamingPolicy.PascalCase
};
var obj = new { firstName = "John", lastName = "Doe" };
string json = JsonSerializer.Serialize(obj, opts);
Console.WriteLine(json);
// Output: {"FirstName":"John","LastName":"Doe"}
using System.Text.Json;
using System.Text.Json.Serialization.Metadata;
var options = new JsonSerializerOptions
{
PropertyNamingPolicy = JsonNamingPolicy.PascalCase
};
JsonTypeInfo<Person> typeInfo = options.GetTypeInfo<Person>();
string json = JsonSerializer.Serialize(new Person("Jane", 30), typeInfo);
Console.WriteLine(json);
// Output: {"Name":"Jane","Age":30}
public record Person(string Name, int Age);
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub weiflycc-cmd/skills --plugin dotnet11