Paste your YAML object and click "Generate Struct" to get a Golang struct definition. Use the checkbox to include omitempty tags in the struct fields.
omitempty
name: John Doe age: 30 email: john@example.com address: street: 123 Main St city: New York zipcode: "10001" hobbies: - reading - swimming is_active: true
type Root struct { Address Address `yaml:"address,omitempty"` Age int `yaml:"age,omitempty"` Email string `yaml:"email,omitempty"` Hobbies []string `yaml:"hobbies,omitempty"` IsActive bool `yaml:"is_active,omitempty"` Name string `yaml:"name,omitempty"` } type Address struct { City string `yaml:"city,omitempty"` Street string `yaml:"street,omitempty"` Zipcode string `yaml:"zipcode,omitempty"` }