go get -u github.com/rookiejin/swagger
package somepkg
// @def Model <- defined Model use @def
type Model struct{
Id int <- support int* float* , bson.ObjectId , if it`s array please use definitions
SomeArray []Array `swag:"Array"` <- the Array should be defined
}
// @def Array
type Array struct {
SomeStruct string
}
// @Param fieldName InWhere Type isRequired Description
// @Param name query string true "name of the pets"
// @Param file formData file true "the file to upload "
// @Param pets body @Model true "the defined model"
// @Param page path string false "page in path"
// @Success 200 {object} @ArticleTag "ok"
// @Failure 400 {object} @ArticleTag "error message"