Generate Go structs, Python dataclasses, and Rust serde structs from a JSON sample, with nested types.
JSON tags
type Geo struct {
Lat float64 `json:"lat"`
Lng float64 `json:"lng"`
}
type Address struct {
Street string `json:"street"`
City string `json:"city"`
Zip string `json:"zip"`
Geo Geo `json:"geo"`
}
type Item struct {
SKU string `json:"sku"`
Qty int64 `json:"qty"`
Price float64 `json:"price"`
}
type Order struct {
OrderID string `json:"orderId"`
Total float64 `json:"total"`
Shipped bool `json:"shipped"`
Coupon interface{} `json:"coupon,omitempty"`
Items []Item `json:"items"`
Note string `json:"note,omitempty"`
}
type Root struct {
ID int64 `json:"id"`
Username string `json:"username"`
Email string `json:"email"`
IsActive bool `json:"isActive"`
Balance float64 `json:"balance"`
Address Address `json:"address"`
Roles []string `json:"roles"`
Orders []Order `json:"orders"`
}