Generate code
Create C#, Java, TypeScript and Python classes from JSON, YAML or XML.
Paste an API response and get typed classes for your project. Quap infers types from the values, merges the shapes of array items, and names nested classes after their keys. Code generation works from JSON, YAML and XML documents.
Steps
- Open the document and click Conv in the preview toolbar.
- Choose → C#, → Java, → TypeScript or → Python.
- Set the options (below). The output updates as you change them.
- Copy the code.
Options
| Group | Options |
|---|---|
| Property | PascalCase names, Use fields instead of properties, Nullable primitives |
| Attributes | JsonProperty (Newtonsoft), NullValueHandling.Ignore, JsonPropertyName (.NET) |
| Class | Immutable classes, Record types |
| Lists | Readonly lists |
| Examples | Generate examples — adds a usage snippet that deserialises the document |
Example
{ "id": 7, "customer": { "name": "Ada", "email": "ada@example.com" }, "tags": ["new"] }export interface Customer {
email: string;
name: string;
}
export interface Root {
customer: Customer;
id: number;
tags: string[];
}Ask the AI assistant for the same thing in words: "generate TypeScript types for this document".