-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathicanhazdadjoke.yaml
108 lines (108 loc) · 2.97 KB
/
icanhazdadjoke.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
openapi: 3.0.0
info:
title: icanhazdadjoke API
version: 1.0.0
description: The icanhazdadjoke API allows users to retrieve random dad jokes or search for jokes by keyword.
servers:
- url: https://icanhazdadjoke.com
paths:
/:
get:
summary: Retrieve a random dad joke
operationId: getRandomJoke
parameters:
- $ref: "#/components/parameters/AcceptHeader"
responses:
'200':
description: A random dad joke
content:
text/plain:
schema:
type: string
application/json:
schema:
type: object
properties:
id:
type: string
joke:
type: string
status:
type: integer
/search:
get:
summary: Search for dad jokes
operationId: searchJokes
parameters:
- $ref: "#/components/parameters/AcceptHeader"
- in: query
name: term
description: The keyword to search for
schema:
type: string
- in: query
name: limit
description: The number of results to return per page (max 30)
schema:
type: integer
maximum: 30
default: 20
- in: query
name: page
description: The page number of results to retrieve
schema:
type: integer
minimum: 1
default: 1
responses:
'200':
description: A list of dad jokes matching the search term
content:
application/json:
schema:
type: object
properties:
current_page:
type: integer
limit:
type: integer
next_page:
type: integer
previous_page:
type: integer
results:
type: array
items:
type: object
properties:
id:
type: string
joke:
type: string
search_term:
type: string
status:
type: integer
total_jokes:
type: integer
total_pages:
type: integer
'400':
description: Invalid input parameter
content:
application/json:
schema:
type: object
properties:
error:
type: string
components:
parameters:
AcceptHeader:
name: Accept
in: header
description: Type to be consumed
schema:
type: string
enum: [ application/json, text/plain, text/html ]
required: true