-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswagger.json
108 lines (108 loc) · 2.58 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
{
"info": {
"title": "Example API",
"description": "API for creating and editing examples.",
"version": "1.1"
},
"basePath": "/",
"tags": [
{
"name": "users",
"description": "A User represents a person who can login \n and take actions subject to their granted permissions."
}
],
"schemes": [
"http",
"https"
],
"swagger": "2.0",
"paths": {
"/user/{_id}": {
"get": {
"responses": {
"200": {
"schema": {
"type": "object",
"properties": {
"userId": {
"type": "string",
"description": "User id"
}
},
"description": "User object"
},
"description": "User object"
}
},
"parameters": [
{
"type": "string",
"pattern": "/^[a-zA-Z0-9]*$/",
"maxLength": 24,
"description": "User id",
"name": "_id",
"in": "path"
}
],
"summary": "获取用户信息",
"description": "Note: \nSensitive data can only be viewed by the `corresponding user` or `Admin`.",
"tags": [
"users"
]
}
},
"/signup": {
"post": {
"responses": {
"200": {
"schema": {
"type": "object",
"properties": {
"userId": {
"type": "string",
"description": "Newly created user id"
}
}
},
"description": "Success"
}
},
"consumes": [
"application/json"
],
"parameters": [
{
"name": "body",
"in": "body",
"schema": {
"type": "object",
"required": [
"username",
"password"
],
"properties": {
"username": {
"type": "string",
"pattern": "/^[a-zA-Z0-9]*$/",
"minLength": 3,
"maxLength": 30
},
"password": {
"type": "string",
"pattern": "/^[a-zA-Z0-9]*$/",
"minLength": 6,
"maxLength": 30
}
}
}
}
],
"summary": "用户注册",
"description": "使用用户名和密码注册。",
"tags": [
"users"
]
}
}
}
}