-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenapi.yaml
217 lines (217 loc) · 5.18 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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
openapi: 3.1.0
info:
title: Test Generation Demo
version: 0.1.0
servers:
- url: http://localhost:35123
description: The default server.
tags:
- name: users
- name: drinks
security:
- apiKey: []
paths:
/anything/user:
post:
operationId: createUser
x-speakeasy-name-override: create
# x-speakeasy-test: false
tags:
- users
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/User"
required: true
responses:
"200":
description: Success
content:
application/json:
schema:
$ref: "#/components/schemas/User"
/anything/user/{id}:
parameters:
- name: id
in: path
required: true
schema:
type: string
example: "90d8257b-5a84-4510-97c3-dabf1bfa361b"
get:
operationId: getUser
x-speakeasy-name-override: get
summary: Get User
tags:
- users
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/User"
put:
operationId: updateUser
x-speakeasy-name-override: update
summary: Update User
tags:
- users
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/User'
required: true
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/User'
delete:
operationId: deleteUser
x-speakeasy-name-override: delete
summary: Delete User
tags:
- users
responses:
"200":
description: OK
/anything/drink/{id}:
post:
operationId: createDrink
# x-speakeasy-test: false
x-speakeasy-name-override: create
tags:
- drinks
parameters:
- name: id
in: path
required: true
schema:
type: string
examples:
createBeer:
value: "3a996362-8f81-4d2a-aced-d3d57474e6e9"
createCoffee:
value: "7afd487f-5fa2-478f-9726-ff80ec8e75f1"
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/Drink"
examples:
createBeer:
value:
{
"id": "3a996362-8f81-4d2a-aced-d3d57474e6e9",
"type": "Beer",
"price": 3.99,
}
createCoffee:
value:
{
"id": "7afd487f-5fa2-478f-9726-ff80ec8e75f1",
"type": "Coffee",
"price": 1.99,
}
required: true
responses:
"200":
description: Success
content:
application/json:
schema:
type: object
properties:
json:
$ref: "#/components/schemas/Drink"
required:
- json
examples:
createBeer:
value:
{
"json":
{
"id": "3a996362-8f81-4d2a-aced-d3d57474e6e9",
"type": "Beer",
"price": 3.99,
},
}
createCoffee:
value:
{
"json":
{
"id": "7afd487f-5fa2-478f-9726-ff80ec8e75f1",
"type": "Coffee",
"price": 1.99,
},
}
components:
schemas:
User:
type: object
properties:
id:
type: string
example: "90d8257b-5a84-4510-97c3-dabf1bfa361b"
name:
type: string
example: "John Doe"
address:
type: object
properties:
street:
type: string
example: "123 Main St"
city:
type: string
example: "San Francisco"
state:
type: string
example: "CA"
zip:
type: string
example: "94107"
age:
type: integer
format: int32
example: 30
gender:
type: string
enum:
- MALE
- FEMALE
- OTHER
example: MALE
required:
- id
- name
- address
- age
- gender
Drink:
type: object
properties:
id:
type: string
type:
type: string
enum: [Beer, Coffee, Wine]
price:
type: number
format: double
required:
- id
- type
- price
securitySchemes:
apiKey:
type: apiKey
name: X-API-Key
in: header