Closed brock-weaver-roostify closed 3 years ago
Would be nice to have the "example" annotation optionally emitted, which is used by swaggo.
e.g.: This:
{ "name":"Frank" }
would emit:
type AutoGenerated struct { Name string `json:"name" example:"Frank"` }
In case there are multiple values, grabbing the most convenient one would make sense. e.g.:
{ "people": [ { "name":"Frank" }, { "name":"Dennis" }, { "name":"Dee" }, { "name":"Charley" }, { "name":"Mac" }, ] }
type AutoGenerated struct { People []struct { Name string `json:"name" example:"Frank"` } `json:"people"` }
I will have a PR for this shortly.
Would be nice to have the "example" annotation optionally emitted, which is used by swaggo.
e.g.: This:
would emit:
In case there are multiple values, grabbing the most convenient one would make sense. e.g.:
would emit:
I will have a PR for this shortly.