2 Star 1 Fork 1.4K

baseshell / swagger-bootstrap-ui

forked from 萧明 / knife4j 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
swagger-annotation.md 1.11 KB
一键复制 编辑 原始数据 按行查看 历史
肖玉明 提交于 2017-04-19 14:59 . init

Swagger 注解说明

Swagger的注解位于swagger-annotations基础jar包中,如图:

常用注解说明

  • @Api:一般用于Controller中,用于接口分组,使用如下图:

  • @ApiOperation:接口说明,用于api方法上

  • @ApiImplicitParam:参数说明,适用于只有一个请求参数,主要参数 | 模块名称 | 说明 | | :--- | :--- | | name | 参数名称 | | value | 参数中文说明 | | required | 是否请求必须,boolean值 | | dataType | 数据类型 |

  • @ApiImplicitParams:多个参数说明,主要参数参考上面@ApiImplicitParam

  • @ApiModelProperty:实体参数说明

实体类:

Controller类:

Java
1
https://gitee.com/baseshell/swagger-bootstrap-ui.git
git@gitee.com:baseshell/swagger-bootstrap-ui.git
baseshell
swagger-bootstrap-ui
swagger-bootstrap-ui
master

搜索帮助