You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Returns allows you to document what responses (errors or regular) can be expected.// The model parameter is optional ; either pass a struct instance or use nil if not applicable.func (b*RouteBuilder) Returns(codeint, messagestring, modelinterface{}) *RouteBuilder {
err:=ResponseError{
Code: code,
Message: message,
Model: model,
IsDefault: false, // this field is deprecated, use default response instead.
}
// lazy init because there is no NewRouteBuilder (yet)ifb.errorMap==nil {
b.errorMap=map[int]ResponseError{}
}
b.errorMap[code] =errreturnb
}
now I can not use code to describe the response header, it can not automatically generate a complete swagger doc.
is there any way I can generate response header spec?
The text was updated successfully, but these errors were encountered:
If you use go-restful-openapi then with the PostBuildSwaggerObjectHandler you can perhaps achieve what you want. Your question is not clear about what you are missing in "describe the response header"
now I can not use code to describe the response header, it can not automatically generate a complete swagger doc.
is there any way I can generate response header spec?
The text was updated successfully, but these errors were encountered: