-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathopenapi.yml
211 lines (210 loc) · 6.47 KB
/
openapi.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
# This is an OpenAPI description for the Owen Wilson Wow API.
# You can view the resulting docs on ReadMe: https://wow.readme.io
openapi: 3.0.0
info:
version: 1.0.1
title: The Owen Wilson Wow API
license:
name: MIT
servers:
- url: https://owen-wilson-wow-api.onrender.com/wows
paths:
/random:
get:
summary: Random "Wow"
description: Retrieve a random "wow" in JSON format.
operationId: random
tags:
- wow
parameters:
- name: results
in: query
description: Retrieve a specific number of random "wow" results.
required: false
example: 5
schema:
type: integer
- name: year
in: query
description: Retrieve a random "wow" from a specific year.
required: false
example: 2011
schema:
type: integer
- name: movie
in: query
description: Retrieve a random "wow" by the name of the movie it appears in.
required: false
example: zoolander
schema:
type: string
- name: director
in: query
description: Retrieve a random "wow" from a movie with a particular director.
required: false
example: wes anderson
schema:
type: string
- name: wow_in_movie
in: query
description: Retrieve a random "wow" by the number of its occurrence in a movie.
required: false
example: 2
schema:
type: integer
- name: sort
in: query
description: Sort multiple random results by either movie, release_date, year, director, or number_current_wow.
required: false
example: movie
schema:
type: string
enum: [movie, release_date, year, director, number_current_wow]
- name: direction
in: query
description: Sort direction can be either asc (ascending) or desc (descending).
required: false
example: asc
schema:
type: string
enum: [asc, desc]
responses:
"200":
description: An array of movies
content:
application/json:
schema:
$ref: "#/components/schemas/Wows"
/ordered/{index}:
get:
summary: Ordered "Wow"
description: Retrieve "wow" results by their index in the chronological order of all results.
operationId: ordered
tags:
- wow
parameters:
- name: index
in: path
description: Index within results array. Either a single index or a range. Range is between a first index and a second index, inclusive.
required: true
examples:
single:
value: 0
range:
value: 3-7
schema:
type: string
responses:
"200":
description: Either a single movie or an array of movies
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/Wow"
- $ref: "#/components/schemas/Wows"
"400":
description: Bad Request
content:
text/html:
schema:
type: string
examples:
response:
summary: Invalid index input
value: "400 Bad Request: Index should be a number or a range between two numbers"
/movies:
get:
summary: All Movies
description: Retrieve all names of movies in which Owen Wilson says "wow."
operationId: movies
tags:
- metadata
responses:
"200":
description: An array of movies
content:
application/json:
schema:
type: array
items:
type: string
example: Cars
/directors:
get:
summary: All Directors
description: Retrieve all directors of movies in which Owen Wilson says "wow."
operationId: directors
tags:
- metadata
responses:
"200":
description: An array of directors
content:
application/json:
schema:
type: array
items:
type: string
example: Wes Anderson
components:
schemas:
Wow:
type: object
properties:
movie:
type: string
example: Midnight in Paris
year:
type: integer
example: 2011
release_date:
type: string
format: date
example: 2011-05-20
director:
type: string
example: Woody Allen
character:
type: string
example: Gil Pender
movie_duration:
type: string
example: 01:33:57
timestamp:
type: string
example: 00:58:22
full_line:
type: string
example: Wow.
current_wow_in_movie:
type: integer
example: 5
total_wows_in_movie:
type: integer
example: 10
poster:
type: string
example: https://images.ctfassets.net/bs8ntwkklfua/2ZcfSCe2dlfoVzYMr4b9nK/d566e5ad044dee56645f3bffc7200d64/Midnight_in_Paris_Poster.jpg
video:
type: object
properties:
1080p:
type: string
example: https://videos.ctfassets.net/bs8ntwkklfua/1DSaYjQ8SnL1Imeuxe0eXE/100d3106c8a0bf5e80372e2187daf325/Midnight_in_Paris_Wow_5_1080p.mp4
720p:
type: string
example: https://videos.ctfassets.net/bs8ntwkklfua/eFI1n7voe4CsxkWEWv2q0/36781ed8f50e508e8e1f79c8e65e601a/Midnight_in_Paris_Wow_5_720p.mp4
480p:
type: string
example: https://videos.ctfassets.net/bs8ntwkklfua/6oSaIzfy7k3DJMvvy3j1kN/d77192d7decb3ba9d06a5210a58df1fa/Midnight_in_Paris_Wow_5_480p.mp4
360p:
type: string
example: https://videos.ctfassets.net/bs8ntwkklfua/4LQ4lkhx41XDC6UcMlmjbA/dfd5e3604c85c9fb9d38ea2dfdd02a2f/Midnight_in_Paris_Wow_5_360p.mp4
audio:
type: string
example: https://assets.ctfassets.net/bs8ntwkklfua/2A5G34x8JCQBuYwU4D2l9S/27cc467b3ff5796ff1bbe113a06a6e64/Midnight_in_Paris_Wow_5.mp3
Wows:
type: array
items:
$ref: "#/components/schemas/Wow"