Generate C# classes with JsonPropertyName attributes from a typical REST API JSON response. Paste your API output and get production-ready C# class files.
// Generated by DevBento — json-to-typescript
interface RootAddress {
street: string;
city: string;
zip: string;
}
interface RootPostsItem {
title: string;
likes?: number;
}
interface Root {
id: number;
name: string;
email: string;
isActive: boolean;
roles: string[];
address: RootAddress;
posts: RootPostsItem[];
}This example generates C# classes with JsonPropertyName attributes from a typical REST API response. The pre-filled JSON represents a user object with nested address, array of roles, and array of post objects. Switch to C# mode to see the generated classes.
The tool produces:
Root class with all top-level propertiesRootUser class for the nested address objectRootPostsItem class for array items[JsonPropertyName("key")] attributes on every propertyT?) for optional fieldsstring, long, double, bool, List<T>C# classes with JsonPropertyName attributes are the standard way to deserialize API responses in .NET. The generated code works directly with JsonSerializer.Deserialize<T>. Use nullable types for fields that may not always be present in the response.
Nothing you paste leaves this tab. Every tool runs entirely in your browser — no upload, no server, no account.