TypeScript from a JSON sample
Paste the response body and get the interfaces for it. Objects become interfaces, arrays become T[], a key missing from some objects in an array becomes an optional member, and null values stay null until a second sample widens them.
Interfaces, types, readonly
Three checkboxes shape the declarations. type instead of interface switches every declaration to a type alias. readonly members adds readonly to each property, which is the right default for data that comes off the wire and should never be mutated in place. Name unions gives each inferred union its own alias instead of inlining string | number at every use.
Runtime checking
With Types only unchecked, the output ends in a Convert class. Convert.toCustomer(json) parses a string and walks the result against the type, throwing with the property path when a value does not match. That turns a compile-time assumption into a runtime guarantee at the boundary where the JSON arrives. Uncheck Runtime type check to keep the class as plain JSON.parse wrappers, or check Types only to drop it.
Example
{ "user_id": 12, "roles": ["admin", "editor"], "last_login": "2025-04-01T10:00:00Z" }
With camelCase properties on and dates inferred:
export interface Root {
userId: number;
roles: string[];
lastLogin: Date;
}
The Convert class, when included, maps userId back to user_id on serialization.
Limits
TypeScript has no integer type, so every number is number. A string that contains only digits is inferred as a number unless Integers from numeric strings is turned off under Inference, which is the right setting for postal codes and ids.