-
Notifications
You must be signed in to change notification settings - Fork 5
/
advice-slip.yaml
73 lines (73 loc) · 2.39 KB
/
advice-slip.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
openapi: "3.0.0"
info:
title: Random Advice API
version: 1.0.0
description: API to get a random advice slip or search for advice by query
license:
name: MIT
url: https://opensource.org/licenses/MIT
contact:
name: Random Advice API Support
email: [email protected]
url: https://randomadviceapi.com
servers:
- url: https://api.adviceslip.com
description: Production server
paths:
/advice:
get:
summary: Retrieve a random advice slip
description: Returns a random advice slip as a slip object.
responses:
"200":
description: Successfully returned results.
content:
application/json:
schema:
type: object
properties:
slip:
type: object
properties:
slip_id:
type: integer
description: The unique ID of this advice slip.
advice:
type: string
description: The advice being given.
/advice/search/{query}:
get:
summary: Search for advice by query
description: If an advice slip is found, containing the corresponding search term in {query}, an array of slip objects is returned inside a search object.
parameters:
- name: query
in: path
description: The search query.
required: true
schema:
type: string
responses:
"200":
description: Successfully returned results.
content:
application/json:
schema:
type: object
properties:
total_results:
type: integer
description: Total number of matching advice slips found.
query:
type: string
description: The search query provided.
slips:
type: array
items:
type: object
properties:
slip_id:
type: integer
description: The unique ID of this advice slip.
advice:
type: string
description: The advice being given.