Swagger注解-@Api
Swagger注解-@ApiOperation
Swagger注解-@ApiImplicitParams 和 @ApiImplicitParam
Swagger注解-@ApiModel 和 @ApiModelProperty
Swagger注解-@ApiResponses 和 @ApiResponse
Swagger注解-@ResponseHeader
Swagger注解-@ApiParam
Swagger注解-@Authorization 和 @AuthorizationScope
Swagger注解-@SwaggerDefinition
Swagger注解-@ExternalDocs
Springboot 集成 Swagger GitHub 地址
使用场景
在 Rest 接口类上边使用。
概述
标记类为 Swagger 资源类,运行时有效。
属性
属性名称 | 数据类型 | 默认值 | 说明 |
---|---|---|---|
value | String | “” | 隐式设置操作的标记,遗留支持(读取 description) |
tags | String[] | “” | 对接口进行分组 |
produces | String | “” | 采用逗号分隔的 content types,例如:application/json,application/xml 生成JSON和XML的输出 |
consumes | String | “” | 采用逗号分隔的 content types,例如: application/json,application/xml 会接收JSON和XML的输入 |
protocols | String | “” | 采用逗号分隔的可用协议,例如:http,https,ws,wss |
authorizations | Authorization[] | “” | 授权列表 |
hidden | boolean | false | 隐藏此资源下的操作, 和 @ApiOperation 注解中的 hidden 组合使用可以隐藏改接口 |
Swagger注解-@Api
Swagger注解-@ApiOperation
Swagger注解-@ApiImplicitParams 和 @ApiImplicitParam
Swagger注解-@ApiModel 和 @ApiModelProperty
Swagger注解-@ApiResponses 和 @ApiResponse
Swagger注解-@ResponseHeader
Swagger注解-@ApiParam
Swagger注解-@Authorization 和 @AuthorizationScope
Swagger注解-@SwaggerDefinition
Swagger注解-@ExternalDocs
Springboot 集成 Swagger GitHub 地址