How types are inferred
- Strings, numbers and booleans map to
string,numberandboolean; null maps tonull. - Nested objects get their own named interface (e.g.
address→Address). - Arrays are typed from their items; arrays of objects get an item interface with a singular name.
- Keys that appear in only some array items are marked optional (
?). - Keys that are not valid identifiers are quoted.
Tips
Use a realistic sample with every field filled in at least once, so optional and nullable fields are detected. Review the result and refine union types (for example string literals) by hand where your API documents them.
Frequently asked questions
Interface or type alias?
Interfaces are generated because they are easy to extend; a type alias is used only when the root JSON is not an object.
Why is a field typed as unknown[]?
The sample array was empty, so the item type could not be inferred.
Is the JSON sent to a server?
No, generation happens in your browser.

