Converters
JSON to type definitions
Generate TypeScript, Go, and Python types from a JSON sample
How to use / Notes
How to use
- Paste a JSON sample—an API response, for example—into the left pane.
- Choose the output language: TypeScript, Go, or Python.
- Rename the root type if you like; nested objects are named after their key.
- Copy the generated definitions into your project.
Notes
- Types are inferred from one sample, so fields and values the sample never shows cannot be represented.
- Array elements are merged, so keys missing from some elements become optional—include several shapes for a better result.
- JSON does not distinguish integers from floats; a value without a decimal point is inferred as an integer type.
- A field that is only ever null carries no type, so it becomes null in TypeScript and any/Any in Go and Python.
- Dates and UUIDs are inferred as strings; swap in a richer type after generating if you need one.