What it infers
- Each nested object becomes its own named type, named after its key in PascalCase (
shipping_addressbecomesShippingAddress). - Arrays of objects are merged into one item type. Keys that are missing in some items get
?; differing value types become a union. nullvalues becomenullin a union, orunknownif a key is only ever null.- Keys that are not valid identifiers are quoted.
Limits
Types are inferred from one sample, so they describe what you pasted, not every response the API can return. For a contract you can rely on, generate types from an OpenAPI or JSON Schema document instead.
FAQ
Is my JSON sent to a server?
No. The JSON is parsed and the types are generated in your browser.
Why is a field typed as unknown[]?
The sample had an empty array, so there was nothing to infer the item type from. Paste a sample with at least one item.