Skip to content
rookiejinPublic

About

基于 go-swag 制作的更加完善的swagger注解生成器

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Usage

Install

    go get -u github.com/rookiejin/swagger
  • command
swagger -main main.go
  • Model definitions
    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 definitions
    // @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"
  • Response definitions
    // @Success 200 {object} @ArticleTag "ok"
    // @Failure 400 {object} @ArticleTag "error message"

About

基于 go-swag 制作的更加完善的swagger注解生成器

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

⌂ 换网址