forked from ProlificLabs/shakesearch_old
-
Notifications
You must be signed in to change notification settings - Fork 0
/
shakesearch.yaml
119 lines (117 loc) · 3.57 KB
/
shakesearch.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
openapi: 3.0.0
info:
title: ShakeSearch API
description: ShakeSearch API provides a way for searching Shakespeare's works.
version: 1.0.0
servers:
- url: https://shakesearch-backend.onrender.com/v1
description: production
- url: http://localhost:7001/v1
description: local
tags:
- name: chapter
description: Chapter operations to search and get specific chapters
- name: version
description: API information
paths:
/chapter/search:
get:
tags:
- chapter
summary: Search endpoint
operationId: search
description: By providing a query string, it returns a list of chapters
parameters:
- name: query
in: query
required: true
schema:
type: string
example: "king"
responses:
200:
description: Successful response
content:
application/json:
schema:
type: array
items:
type: object
properties:
id:
type: integer
example: 16
title:
type: string
example: "KING JOHN"
chapter:
type: string
example: "\nTHE LIFE AND DEATH OF KING JOHN\n\n"
description: >
it contains a summary of the chapter's content, full content can be found in the /chapter/{id}
endpoint
400:
description: Bad request, the query string is missing
500:
description: >
Internal server error, it usually happens when the database is not available, or there are some
severe errors in the backend.
/chapter/{id}:
get:
tags:
- chapter
summary: Find a specific chapter by id
operationId: chapter
description: >
By providing a chapter id, it returns the chapter's content. The chapter id can be found in the search
endpoint.
parameters:
- name: id
in: path
required: true
schema:
type: integer
example: 1
responses:
200:
description: Successful response
content:
application/json:
schema:
type: object
properties:
id:
type: integer
example: 16
title:
type: string
example: "KING JOHN"
chapter:
type: string
example: "\nTHE LIFE AND DEATH OF KING JOHN\n\n"
description: it contains chapter's content in full
400:
description: Bad request, something that the user informed in the request is not valid
404:
description: Chapter was not found
500:
description: >
Internal server error, it usually happens when the database is not available, or there are some
severe errors in the backend.
/:
get:
tags:
- version
summary: Version endpoint returns the current API version
operationId: version
responses:
200:
description: It returns the current API version
content:
application/json:
schema:
type: object
properties:
version:
type: string
example: "1.0.0"