-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenapi.yaml
191 lines (191 loc) · 4.38 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
openapi: 3.0.0
paths:
/pets:
post:
operationId: create
x-speakeasy-retries:
strategy: backoff
backoff:
initialInterval: 1000
maxInterval: 80000
maxElapsedTime: 3600000
exponent: 1.5
statusCodes:
- 5XX
retryConnectionErrors: true
summary: Create pet
parameters: []
requestBody:
required: true
description: Create a pet cat or dog
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/Cat'
- $ref: '#/components/schemas/Dog'
responses:
'200':
description: ''
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/Cat'
- $ref: '#/components/schemas/Dog'
'201':
description: ''
content:
application/json:
schema:
type: object
'400':
description: Bad Request
'403':
description: Forbidden
tags:
- pets
/pets/cats/{id}:
get:
operationId: findOneCat
summary: Get cat
parameters:
- name: id
required: true
in: path
schema:
type: string
responses:
'200':
description: The found record
content:
application/json:
schema:
$ref: '#/components/schemas/Cat'
'400':
description: Bad Request
tags:
- cats
/pets/dogs/{id}:
get:
operationId: findOneDog
summary: Get dog
parameters:
- name: id
required: true
in: path
schema:
type: string
responses:
'200':
description: The found record
content:
application/json:
schema:
$ref: '#/components/schemas/Dog'
'400':
description: Bad Request
tags:
- dogs
info:
title: Pet API
description: Create a cat or dog record and view pets by id
version: '1.0'
contact:
name: Speakeasy support
url: http://www.example.com/support
email: [email protected]
termsOfService: http://example.com/terms/
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
tags:
- name: pets
description: Pets operations
externalDocs:
url: https://example.com/api
description: Operations API endpoint
- name: cats
description: ''
- name: dogs
description: ''
servers:
- url: http://localhost:3000/
description: Development server
components:
schemas:
Cat:
type: object
properties:
type:
type: string
description: The type of pet
example: cat
name:
type: string
description: The name of the cat
example: Panama
age:
type: number
description: The age of the cat
example: 1
breed:
type: string
description: The breed of the cat
example: British Short Hair
environment:
type: string
description: Living environment of the cat
example: indoor
enum:
- indoor
- outdoor
required:
- type
- name
- age
- breed
- environment
Dog:
type: object
properties:
type:
type: string
description: The type of pet
example: dog
name:
type: string
description: The name of the dog
example: Fluffy
age:
type: number
description: The age of the dog
example: 4
breed:
type: string
description: The breed of the dog
example: Alaskan Malamute
size:
type: string
description: The Size of the dog'
example: medium
enum:
- small
- medium
- large
required:
- type
- name
- age
- breed
- size
x-speakeasy-retries:
strategy: backoff
backoff:
initialInterval: 500
maxInterval: 60000
maxElapsedTime: 3600000
exponent: 1.5
statusCodes:
- 5XX
retryConnectionErrors: true