首页天道酬勤swagger注解教程,swagger api注解

swagger注解教程,swagger api注解

admin 08-15 00:57 155次浏览

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 接口上或 Rest 接口参数前边使用

概述

为 Rest 接口参数添加其它元数据(导入到 yapi 中不会被解析)

属性 属性名称数据类型默认值说明nameString“”参数名称,参数名称将从 filed/method/parameter 名称中派生,但你可以覆盖它,路径参数必须始终命名为它们所代表的路径部分valueString“”参数简单描述defaultValueString“”描述参数默认值allowableValuesString“”可接收参数值限制,有三种方式,取值列表,取值范围requiredbooleanfalse是否为必传参数, false:非必传; true:必传accessString“”参数过滤,请参阅:io.swagger.core.filter.SwaggerSpecFilterallowMultiplebooleanfalse指定参数是否可以通过多次出现来接收多个值hiddenbooleanfalse隐藏参数列表中的参数exampleString“”非请求体(body)类型的单个参数示例examplesExample@Example(value = @ExampleProperty(mediaType = “”, value = “”))参数示例,仅适用于请求体类型的请求typeString“”添加覆盖检测到类型的功能formatString“”添加提供自定义format格式的功能allowEmptyValuebooleanfalse添加将格式设置为空的功能readOnlybooleanfalse添加被指定为只读的能力collectionFormatString“”添加使用 array 类型覆盖 collectionFormat 的功能

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

java身份证合法性校验工具类实例代码
swagger注释API详细说明 swagger没有apijson注解,java配置swagger注解参数
相关内容