System Text JSON Source Generation Aot

Use when System.Text.Json runs under Native AOT or trimming (PublishAot / PublishTrimmed), or when you want the faster, reflection-free serialization path — i.e. a JsonSerializerContext with [JsonSerializable]. Reflection-based JsonSerializer compiles but THROWS at run time under AOT; the source generator is the only supported path. Also covers configuring a context with [JsonSourceGenerationOptions] and why naming policy is per-context, not per-model, so one type serialized by two contexts can emit two different spellings, plus word-valued enums that must remain trim/AOT-safe.

richlander Updated 161 repo stars

File contents

richlander/dotnet-package-skills commit fb87f0dd38

Frequently asked questions

npx get-skill add richlander/system-text-json-source-generation-aot