-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yml
More file actions
237 lines (234 loc) · 5.95 KB
/
Copy pathopenapi.yml
File metadata and controls
237 lines (234 loc) · 5.95 KB
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
openapi: 3.0.1
info:
title: User API
description: This is an example API to update a users store.
termsOfService: https://github.com/cmwylie19/node-rest-service.git
contact:
email: cwylie@redhat.com
version: 1.0.0
tags:
- name: users
description: Operations on users
paths:
/users:
post:
tags:
- users
summary: Create user
description: This can only be done by the logged in user.
operationId: createUser
requestBody:
description: Created user object
content:
application/json:
schema:
$ref: "#/components/schemas/User"
required: true
responses:
400:
description: conflict
content:
application/json:
schema:
$ref: "#/components/schemas/AccountInUse"
200:
description: created
content:
application/json:
schema:
$ref: "#/components/schemas/ApiResponseOK"
x-codegen-request-body-name: body
get:
tags:
- users
summary: Returns all users.
description: Returns a map of users by email
operationId: getUsers
responses:
200:
description: List of users
content:
application/json:
schema:
type: object
properties:
name:
type: string
role:
type: string
example:
{
"test@redhat.com": { "name": "Test User", "role": "test" },
"test2@redhat.com":
{ "name": "Test User 2", "role": "test" },
}
# security:
# - api_key: []
/users/{email}:
delete:
tags:
- users
summary: Delete user
description: Delete a user from the user store.
operationId: deleteUser
parameters:
- name: email
in: path
description: The email of the user that needs to be deleted
required: true
schema:
type: string
responses:
200:
description: success
content:
application/json:
schema:
$ref: "#/components/schemas/ApiResponseOK"
400:
description: success
content:
application/json:
schema:
$ref: "#/components/schemas/EmailNotFound"
get:
tags:
- users
summary: Get user by user name
operationId: getUser
parameters:
- name: email
in: path
description: Email of the user to get.
required: true
schema:
type: string
responses:
200:
description: success
content:
application/json:
schema:
$ref: "#/components/schemas/SingleUser"
400:
description: success
content:
application/json:
schema:
$ref: "#/components/schemas/EmailNotFound"
put:
tags:
- users
summary: Updated user
description: Update a given user.
operationId: editUser
parameters:
- name: email
in: path
description: Email of user to be updated.
required: true
schema:
type: string
requestBody:
description: Updated user object
content:
application/json:
schema:
$ref: "#/components/schemas/User"
required: true
responses:
200:
description: success
content:
application/json:
schema:
$ref: "#/components/schemas/ApiResponseOK"
400:
description: success
content:
application/json:
schema:
$ref: "#/components/schemas/EmailNotFound"
# x-codegen-request-body-name: body
components:
responses:
EmailNotFound:
description: Email not found.
content:
application/json:
schema:
type: string
example: Account not found registered to that email.
EmailRegistered:
description: Email exists.
content:
application/json:
schema:
type: string
example: An acccount has been registered to that email.
OkApiResponse:
description: successful
content:
application/json:
schema:
type: string
example: OK
500ApiError:
description: This is an unexpected 500ApiError
content:
application/json:
schema:
type: string
schemas:
AccountInUse:
type: string
example: An acccount has been registered to that email.
EmailNotFound:
type: string
example: Account not found registered to that email.
ApiResponseError:
type: string
example: User not found
ApiResponseOK:
type: string
example: OK
SingleUser:
type: object
properties:
name:
type: string
role:
type: string
example: { "name": "Test User", "role": "test" }
User:
type: object
properties:
email:
type: string
role:
type: string
name:
type: string
# ApiResponse:
# type: object
# properties:
# code:
# type: integer
# format: int32
# type:
# type: string
# message:
# type: string
# securitySchemes:
# petstore_auth:
# type: oauth2
# flows:
# implicit:
# authorizationUrl: http://petstore.swagger.io/oauth/dialog
# scopes:
# write:pets: modify pets in your account
# read:pets: read your pets
# api_key:
# type: apiKey
# name: api_key
# in: header