Swagger注解-@Authorization 和 @AuthorizationScope


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 地址


@Authorization

使用场景

接口授权,不单独使用,作为 @Api 或 @ApiOperation 的属性使用

概述

定义要在资源或操作上使用的授权方案。使用的授权方案需要首先在Swagger各级别声明。此注解不直接使用,Swagger不会解析,应该作为 @Api 或 @ApiOperation 属性使用

属性

属性名称数据类型默认值说明
valueString要在此资源/操作上使用的授权方案名称。必须在资源列表的授权部分中定义名称
scopesAuthorizationScope[]@AuthorizationScope(scope = “”, description = “”)授权方案为OAuth2时使用的范围

@AuthorizationScope

使用场景

接口授权范围使用,不单独使用,作为 @Authorization 的属性使用

概述

描述 OAuth2 授权范围。用于定义操作用于已定义授权方案的授权范围。此注解不直接使用,Swagger不会解析

属性

属性名称数据类型默认值说明
scopeString要使用的 OAuth2 授权方案的范围。范围应事先在Swagger对象的securityDefinition部分中声明
descriptionString在1.5.X中使用,保留用于旧版本的支持

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 地址


  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值