-
Notifications
You must be signed in to change notification settings - Fork 0
/
swagger.yml
256 lines (238 loc) · 6.99 KB
/
swagger.yml
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
openapi: 3.0.0
info:
title: "Archer API"
description: |
# Introduction
Archer API is a REST API based on the adult animated sitcom Archer.
It provides data about the show's episodes, characters and quotes.
Github: https://github.com/ben-n93/archer_api
version: "1.0.0"
x-logo:
url: 'https://www.archerapi.com/logo.png'
servers:
- url: "/api"
x-tagGroups:
- name: Endpoints
tags:
- Characters
- "Episodes"
- "Quotes"
components:
schemas:
Character:
type: "object"
required:
- id
properties:
id:
type: "integer"
description: "id of the character."
name:
type: "string"
description: "Name of the character."
aliases:
type: "string"
description: "Aliases/nicknames the character is known by."
occupations:
type: "string"
description: "The character's current and former jobs."
first_appearance:
type: "string"
description: "The episode this character first appeared in."
voice_actor:
type: "string"
description: "The character's voice actor."
quotes:
type: "object"
description: "List of quotes said by this character."
Quote:
type: "object"
required:
- id
properties:
id:
type: "integer"
description: "id of the quote."
quote:
type: "string"
description: "Quote from the show."
character:
type: "string"
description: "Character who said the quote."
episode:
type: "string"
description: "Episode in which the quote was said."
Episode:
type: "object"
required:
- id
properties:
id:
type: "integer"
description: "id of the episode."
name:
type: "string"
description: "Name of the episode."
season:
type: "integer"
description: "Season."
ep_number:
type: "integer"
description: "Episode number."
original_air_date:
type: "string"
description: "Date on which the episode first aired."
writers:
type: "string"
description: "People who wrote the episode."
director:
type: "string"
description: "The person who directed the episode."
parameters:
character_id:
name: "character_id"
description: "The id of the resource."
in: path
required: True
schema:
type: "integer"
ids:
name: "ids"
description: "IDs of the resources you want."
in: path
required: True
schema:
type: array
items:
type: integer
paths:
/characters:
get:
operationId: "characters.read_all"
tags:
- "Characters"
summary: "Get all characters."
responses:
"200":
description: "Successfully retrieved all characters."
/characters/{character_id}:
get:
operationId: "characters.read_one"
tags:
- "Characters"
summary: "Get a single character"
description:
You can get a single character by adding the characters's id as a parameter.
Note that if you don't know the character's id you can filter based on their
name - see below (*"Filtering characters"*).
parameters:
- $ref: "#/components/parameters/character_id"
responses:
"200":
description: "Successfully retrieved character."
content:
application/json:
schema:
$ref: '#/components/schemas/Character'
example:
aliases: Magnum P.U.
first_appearance: The Wind Cries Mary
id: 8
name: Rodney
occupations: Requisitions officer, arms dealer
quotes: "[]"
voice_actor: Andrew Donnelly
/quotes:
get:
operationId: "quotes.read_all"
description: "You can access the list of all quotes by using the `/quotes` endpoint."
tags:
- "Quotes"
summary: "Get all quotes"
responses:
"200":
description: "Succesfully retrieved all quotes."
/quotes/{quote_id}:
get:
operationId: "quotes.read_one"
tags:
- "Quotes"
summary: "Get a single quote"
description: "You can get a single quote by adding the quote's id as a parameter."
parameters:
- name: "quote_id"
in: "path"
description: "ID of the quote"
required: true
schema:
type: "integer"
responses:
"200":
description: "Successfully retrieved quote."
content:
application/json:
schema:
$ref: '#/components/schemas/Quote'
example:
character: "Pamela Poovey"
episode: "Dial M for Mother"
id: 1
quote: "Sploosh."
/quotes/random:
get:
operationId: "quotes.get_random"
description: "You can get a random quote using the following endpoint: `quotes/random`"
tags:
- "Quotes"
summary: "Get a random quote"
responses:
"200":
description: "Successfully retrieved a random quote."
content:
application/json:
schema:
$ref: '#/components/schemas/Quote'
example:
- character: "Sterling Malory Archer"
episode: Dial M for Mother
id: 14
quote: Grill me a cheese.
/episodes:
get:
operationId: "episodes.read_all"
tags:
- "Episodes"
summary: "Get all episodes"
description: You can access the list of all episodes by using the `/episodes` endpoint.
responses:
"200":
description: "Succesfully retrieved episodes."
/episodes/{episode_id}:
get:
operationId: "episodes.read_one"
description: "You can get a single episode by adding the episodes's id as a parameter."
tags:
- "Episodes"
summary: "Get a single episode"
parameters:
- name: "episode_id"
in: "path"
description: "ID of the episode"
required: true
schema:
type: "integer"
responses:
"200":
description: "Successfully retrieved episode."
content:
application/json:
schema:
$ref: '#/components/schemas/Episode'
example:
ep_number: 1
id: 2
name: Mole Hunt
original_air_date: 17 Sep, 2009
season: 1
writers: Adam Reed
director: Adam Reed