Install any skill in seconds. Free to start, no credit card required.
Get Started Free →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 this skill ↓50% 91%+41 ptsof test cases passed
Passed 20 of 22 test cases with the skill, and 11 of 22 without it.
In .NET 11 System.Text.Json, what is the exact syntax for obtaining a generic `JsonTypeInfo<T>` for class `Order` from a `JsonSerializerOptions` instance named `opts`?
The expression is opts.GetTypeInfo<Order>()
3 of 3 safety checks passed
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.
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.