0.1.0-snapshot.15 • Published 4 years ago
@zhaochy/egg-swagger-ts v0.1.0-snapshot.15
使用说明
这个项目通过注解的方式生成Swagger文档
支持以下注解:
APIGroup
这个是类注解,作用于Controller上
@APIGroup(options: object)
options包括prefix和tags
Get, Post, Put, Delete, Patch
@Get(path: string)
用于描述url
Summary
@Summary(summary: string)
Description
@Description(description: string)
Security
@Security(type: string)
默认所有API开启JWT认证 如果某个API不需要认证,那么参数type填'none'
Throws
@Throws(code: number)
支持如下错误类型:
- 400
- 401
- 403
- 404
- 500
RequestBody
@RequestBody(schema: object | string)
支持复用项目内置的joi schema(参数为string)
也可以写标准的JSON schema
SuccessBody
@SuccessBody(schema: object)
输出的Response body
Parameter
@Parameter(param: object) 用于描述参数,如果有多个参数,可以写多个注解
0.1.0-snapshot.14
4 years ago
0.1.0-snapshot.15
4 years ago
0.1.0-snapshot.13
4 years ago
0.1.0-snapshot.12
4 years ago
0.1.0-snapshot.11
4 years ago
0.1.0-snapshot.10
4 years ago
0.1.0-snapshot.9
4 years ago
0.1.0-snapshot.8
4 years ago
0.1.0-snapshot.7
4 years ago
0.1.0-snapshot.6
4 years ago
0.1.0-snapshot.5
4 years ago
0.1.0-snapshot.4
4 years ago
0.1.0-snapshot.3
4 years ago
0.1.0-snapshot.2
4 years ago
0.1.0-snapshot.1
4 years ago