JSON to C#
NewGenerate C# records or classes with JsonPropertyName attributes from JSON data.
Frequently Asked Questions
Can I generate classes instead of records?
Yes. Use record types is enabled by default, but you can turn it off to generate standard classes with set accessors instead of init.
Why did property names become PascalCase?
The generator normalizes C# property names to PascalCase. If the original JSON key differs, it adds [JsonPropertyName("...")] to preserve binding.
How are arrays represented?
Arrays become List<T> and the file adds using System.Collections.Generic; when needed. Empty or unknown array items fall back to List<object>.
What happens if the JSON root is an array?
The root type inherits from List<T> instead of creating a wrapper property. That is true for both record and class mode.
How are primitives and nulls handled?
Integers become long, decimals double, null-only values object?, and mixed shapes object. A primitive root gets wrapped in a type with a Value property.