This repository has been archived by the owner on Aug 10, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswagger.json
110 lines (102 loc) · 2.75 KB
/
swagger.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
{
"openapi": "3.0.0",
"info": {
"title": "Moe Ask Api",
"description": "MoeAsk的api文档",
"version": "1.0.0",
"termsOfService": "https://moeask.com/terms/",
"contact": {
"email": "[email protected]"
},
"license": {
"name": "AGPL 3.0",
"url": "https://www.gnu.org/licenses/agpl-3.0.html"
}
},
"servers": [
{
"url": "https://api.moeask.com/{version}",
"description": "主要api服务器",
"variables": {
"version": {
"enum": [
"v1"
],
"default": "v1"
}
}
},
{
"url": "http://localhost:1551/{version}",
"description": "本地测试",
"variables": {
"version": {
"enum": [
"v1"
],
"default": "v1"
}
}
}
],
"tags": [
{
"name": "user",
"description": "用户"
},
{
"name": "question",
"description": "问题"
}
],
"paths": {
"/user": {
"$ref": "routes/user.json"
},
"/user/{user_id}": {
"$ref": "routes/user.user_id.json"
},
"/user/login": {
"$ref": "routes/user.login.json"
},
"/question/{id}": {
"$ref": "routes/question.id.json"
},
"/questions/{page}": {
"$ref": "routes/questions.page.json"
}
},
"components": {
"schemas": {
"Error": {
"$ref": "models/errro.json#/components/schemas/Error"
},
"User": {
"$ref": "models/user.json#/components/schemas/User"
},
"Question": {
"$ref": "models/question.json#/components/schemas/Question"
}
},
"securitySchemes": {
"TokenAuth": {
"type": "apiKey",
"name": "Auth-Token",
"in": "header",
"description": "用于验证用户身份的token。通过登录获得。"
},
"OAuth": {
"type": "oauth2",
"flows": {
"authorizationCode": {
"authorizationUrl": "/oauth/dialog",
"tokenUrl": "/oauth/token",
"scopes": {
"read:user": "获取用户信息"
}
}
}
}
}
}
}