YAML to Struct
Infer nested types from a YAML document and emit structs/classes for nine languages — entirely in your browser.
All processing on this page runs locally in your browser unless noted otherwise.
Suggested file: Root.go
How to use
- Paste YAML or load a template.
- Pick a language and root type name.
- Copy or download the generated code and adjust types as needed.
FAQ
How are types inferred?
From the sample values: numbers become int/float, nested maps become nested types, arrays become slices/lists. Empty arrays become any/unknown/Object.
Is the code production-ready?
Treat it as a starting point. Mixed arrays, nulls and dynamic keys may need manual cleanup.
Does generation leave my device?
No. Parsing and code emission run locally in the browser.