swag
swag copied to clipboard
support array of pointers Model composition in response
Is your feature request related to a problem? Please describe. Support array of pointers for objects as nested response. May be that is no pointless, it can work on array of object. but it diffrent from the code. struct defind:
type ResponsePaginated struct {
Count int64 `json:"count"`
BaseHttpResponse
}
type BaseHttpResponse struct {
Code int `json:"error_code" yaml:"error_code"`
ErrorMessage string `json:"error_message,omitempty" yaml:"error_message,omitempty"`
Data interface{} `json:"data,omitempty" yaml:"data,omitempty"`
ErrorDetail interface{} `json:"error_detail,omitempty" yaml:"error_detail,omitempty"`
}
the annotation of response:
@success 200 {object} httptool.ResponsePaginated{data=[]*coreapi.Pod} "pod list"
executing init return invalid type: httptool.ResponsePaginated{data=[]
Describe the solution you'd like generate docs sucuccess
Describe alternatives you've considered current the solution is replace array of pointers to array of object.
Additional context Add any other context or screenshots about the feature request here.
@wu0407 This is an Open Source project. If this is a must for you, please feel free and contribute through a PR, and we will be more than happy to assist you with a code review.
Is it essential to add * ? It has no effect on the swagger docs.
More in line with go language habits