-
-
Notifications
You must be signed in to change notification settings - Fork 485
Open
Labels
Description
Where there are multiple properties which reuse the same nested properties, the corresponding struct definition should be flattened. Take the following JSON:
{
"filter":{
"sitereference":[
{
"value":"shshs"
}
],
"transactionreference":[
{
"value":"3-64-25205"
}
]
}
}
Expected output:
type AutoGenerated struct {
Filter Filter `json:"filter"`
}
type FilterAutoGenerated struct {
Value string `json:"value"`
}
type Filter struct {
Sitereference []FilterAutoGenerated `json:"sitereference"`
Transactionreference []FilterAutoGenerated `json:"transactionreference"`
}
Actual output:
type AutoGenerated struct {
Filter Filter `json:"filter"`
}
type Sitereference struct {
Value string `json:"value"`
}
type Transactionreference struct {
Value string `json:"value"`
}
type Filter struct {
Sitereference []Sitereference `json:"sitereference"`
Transactionreference []Transactionreference `json:"transactionreference"`
}
michaelsanford and Pilfer