JSON input
Paste JSON, optionally name the root type, then generate.
Your Elixir struct code will appear here.
Generate Elixir structs from JSON with defstruct and typespecs. Nested modules, atom keys, and nilable fields are inferred automatically.
Paste JSON, optionally name the root type, then generate.
Your Elixir struct code will appear here.
JSON has no schema, but Elixir structs demand one. The generator derives that schema from your sample: every object becomes a module with defstruct, every field gets a typespec, and shaky fields include nil().
Phoenix applications constantly translate between JSON and structs. Generating the struct layer from a real payload gives you a typed foundation for contexts, changesets, and JSON views.