dotnet-source-gen-json
Installation
SKILL.md
Configure System.Text.Json source generation for AOT-compatible, reflection-free JSON serialization with compile-time type metadata.
When to Use
- Preparing application for Native AOT compilation
- Eliminating reflection-based serialization overhead
- Improving startup performance by generating serialization code at compile time
- Ensuring JSON serialization errors surface at compile time
Requirements
- .NET 8 or higher for full options support
- .NET 6+ for basic source generation
Steps
- Invoke polymorphic skill first:
- Run
dotnet-json-polymorphicskill to ensure polymorphic types are configured - This ensures
[JsonDerivedType]attributes are in place before generating context
- Run