JSON to Go/Python/Rust Struct Generator
Paste a sample JSON object and generate a matching struct or dataclass.
Advertisement
About this tool
Infers types from the sample's own values. Nested objects, and arrays of objects, generate their own named types, with every item in an array taken into account: a field missing from some items (or sometimes null) becomes optional — a pointer with omitempty in Go, Optional[...] = None in Python, Option<...> in Rust. Keys that aren't valid names in the target language (first-name, class) are renamed, with the original JSON key kept in a tag, comment or #[serde(rename)], and a top-level array becomes a list type.