-
Notifications
You must be signed in to change notification settings - Fork 58
/
custom_endpoints.yaml
executable file
·326 lines (326 loc) · 9.34 KB
/
custom_endpoints.yaml
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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
openapi: 3.0.0
info:
title: Help Center API
version: 1.0.0
description: API documentation for the Help Center application
servers:
- url: http://127.0.0.1:8000
description: Local server
- description: Subscription Plan and Feature
url: https://virtserver.swaggerhub.com/bhimbho/SubPlanFeature/1.0.0
tags:
- name: help-center
description: Help Center API operations
- name: features
description: Feature operations
- name: plans
description: Plan operations
paths:
/api/v1/help-center/topics/search:
get:
tags:
- help-center
summary: Search help center topics
description: Retrieves articles based on the search query provided in the title parameter
parameters:
- name: title
in: query
required: true
schema:
type: string
description: The title or part of the title of the article to search for
responses:
'200':
description: A list of articles matching the search query
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
example: true
message:
type: string
example: Articles found
status_code:
type: integer
example: 200
topics:
type: array
items:
type: object
properties:
article_id:
type: string
example: "3e8b8c0-d1ca-4b9e-a97f-d4c2413ac930"
author:
type: string
example: Clifton Satterfield
title:
type: string
example: How to update your profile
content:
type: string
example: To update your profile, go to the settings page...
'400':
description: Bad request, possibly due to missing or invalid parameters
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
example: false
message:
type: string
example: Invalid request parameters
status_code:
type: integer
example: 400
'429':
description: Too many requests due to rate limiting
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
example: false
message:
type: string
example: Too many requests, please try again later
status_code:
type: integer
example: 429
'500':
description: Internal server error
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
example: false
message:
type: string
example: Internal server error
status_code:
type: integer
example: 500
/features:
post:
tags:
- features
summary: creates a feature for reuse
operationId: addFeature
description: creates a feature for reuse
responses:
'201':
description: feature created successfully
content:
application/json:
schema:
$ref: '#/components/schemas/Features'
'401':
description: Unauthenticated
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: Unauthenticated
'422':
description: validation error
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: one or more validation errors
errors:
type: array
items:
properties:
name:
type: string
example: name field required
'400':
description: feature creation failed
content:
application/json:
schema:
type: object
properties:
error:
type: string
example: feature creation failed
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/FeaturesInput'
description: Inventory item to add
/plans:
post:
tags:
- plans
summary: creates a subscription plan
operationId: addplan
description: Adds an item to the system
responses:
'201':
description: subscription plan created successfully
content:
application/json:
schema:
$ref: '#/components/schemas/SubscriptionPlan'
'401':
description: Unauthenticated
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: Unauthenticated
'422':
description: validation error
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: one or more validation errors
errors:
type: array
items:
properties:
name:
type: string
example: name field required
'400':
description: creation of subscription plan failed
content:
application/json:
schema:
type: object
properties:
error:
type: string
example: creation of subscription plan failed
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/SubscriptionPlanInput'
description: Inventory item to add
components:
schemas:
SubscriptionPlan:
type: object
required:
- name
- price
- duration
- description
properties:
id:
type: string
format: uuid
example: d290f1ee-6c54-4b01-90e6-d701748f0851
name:
type: string
example: basic
price:
type: integer
example: 1000
duration:
type: string
example: monthly
description:
type: string
example: this plan is valid for one month with extra 3days
features:
type: array
items:
type: object
$ref: '#/components/schemas/Features'
Features:
required:
- name
- status
properties:
name:
type: string
example: 2TB space
description:
type: string
format: string
example: 'xeoo'
status:
type: integer
description: Status of the feature (can only be 1 or 0)
example: 1
status_text:
type: string
description: Status text of the feature (can only be active or inactive)
example: active
SubscriptionPlanInput:
type: object
required:
- name
- price
- duration
- description
properties:
id:
type: string
format: uuid
example: d290f1ee-6c54-4b01-90e6-d701748f0851
name:
type: string
example: basic
price:
type: integer
example: 1000
duration:
type: string
example: monthly
description:
type: string
example: this plan is valid for one month with extra 3days
features:
type: array
items:
type: object
properties:
id:
type: string
format: uuid
example: xxxx-xxxxx-xxxxx-xxxxxx
status:
type: string
example: 1 for active 0 for inactive
FeaturesInput:
required:
- name
- status
properties:
name:
type: string
example: 2TB space
description:
type: string
format: string
example: 'xeoo'