Option to generate non-anonymous structs as output
See original GitHub issueI have found this application extremely useful. Thank you for your time and effort!
However, to enable the re-use of the nested structures ( not just for parsing ) , It would be great to have an option to generate named structs. Instead of this
type ConfigurationData struct {
ApplicationDisplay struct {
Title string `json:"title"`
Subtitle string `json:"subtitle"`
WelcomeMessage string `json:"welcomeMessage"`
} `json:"applicationDisplay"`
}
it would generate
type ApplicationDisplay struct {
Title string `json:"title"`
Subtitle string `json:"subtitle"`
WelcomeMessage string `json:"welcomeMessage"`
}
type ConfigurationData struct {
ApplicationDisplay ApplicationDisplay `json:"applicationDisplay"`
}
Issue Analytics
- State:
- Created 6 years ago
- Reactions:12
- Comments:16 (6 by maintainers)
Top Results From Across the Web
Using an anonymous struct vs a named struct with typedef
One situation where you want the non-anonymous is when you want pointers to an object of the same type, like in a linked...
Read more >Structs in Go (Golang) | Detailed Tutorial with Examples
A struct is a user defined data type which represents a collections of fields. Structs can either be named or anonymous.
Read more >ANSI-C nested, anonymous struct and union fail to produce ...
Given the examples below, I've not found a way to have doxygen generate ideal output for types with nested anonymous structs and unions, ......
Read more >Kernel-doc comments — The Linux Kernel documentation
The kernel-doc structure is extracted from the comments, and proper Sphinx C Domain function and type descriptions with anchors are generated from them....
Read more >Anonymous Union and Structure in C
Anonymous unions/structures are also known as unnamed unions/structures as they don't have names. Since there is no names, direct objects(or ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@suntong
json-to-go.js
and hit enter.I haven’t deployed the latest on master yet, but you’re welcome to use it: https://github.com/mholt/json-to-go/pull/49