-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathopenapi.yaml
196 lines (196 loc) · 4.56 KB
/
openapi.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
openapi: 3.1.0
externalDocs:
description: Find out more about Users API
url: https://www.example.com
servers:
- url: http://localhost:3000/
description: Development server
x-speakeasy-retries:
strategy: backoff
backoff:
initialInterval: 500
maxInterval: 60000
maxElapsedTime: 3600000
exponent: 1.5
statusCodes:
- 5XX
retryConnectionErrors: true
tags:
- name: Users
description: Users operations
externalDocs:
description: Find more info here
url: https://example.com
info:
version: 1.0.0
title: Users API
components:
schemas:
UserSelect:
type: object
properties:
id:
type: string
example: '123'
name:
type: string
example: John Doe
age:
type: number
example: 42
required:
- id
- name
- age
createMessageObject:
type: object
properties:
message:
type: string
required:
- message
example:
message: Not Found
createError:
type: object
properties:
issues:
type: array
items:
type: object
properties:
code:
type: string
path:
type: array
items:
anyOf:
- type: string
- type: number
message:
type: string
required:
- code
- path
name:
type: string
required:
- issues
- name
UserInsert:
type: object
properties:
name:
type: string
example: John Doe
age:
type: number
example: 42
required:
- name
- age
idParams:
type: string
minLength: 3
example: '423'
parameters: {}
paths:
/users:
get:
operationId: getUsers
tags:
- Users
x-speakeasy-retries:
strategy: backoff
backoff:
initialInterval: 300
maxInterval: 40000
maxElapsedTime: 3000000
exponent: 1.2
statusCodes:
- 5XX
retryConnectionErrors: true
responses:
'200':
description: The list of users
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/UserSelect'
post:
operationId: createUser
requestBody:
description: The user to create
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UserInsert'
responses:
'200':
description: The created user
content:
application/json:
schema:
$ref: '#/components/schemas/UserSelect'
'404':
description: User not found
content:
application/json:
schema:
$ref: '#/components/schemas/createMessageObject'
'422':
description: The validation error(s)
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
example: false
error:
$ref: '#/components/schemas/createError'
required:
- success
- error
/users/{id}:
get:
operationId: getUser
parameters:
- schema:
$ref: '#/components/schemas/idParams'
required: true
name: id
in: path
responses:
'200':
description: The requested user
content:
application/json:
schema:
$ref: '#/components/schemas/UserSelect'
'404':
description: User not found
content:
application/json:
schema:
$ref: '#/components/schemas/createMessageObject'
'422':
description: Invalid id error
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
example: false
error:
$ref: '#/components/schemas/createError'
required:
- success
- error
webhooks: {}