-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrequestSchema.yaml
196 lines (191 loc) · 4.68 KB
/
requestSchema.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
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
openapi: "3.0.0"
info:
version: 1.0.0
title: Babycenter Frontend
license:
name: MIT
servers:
- url: http://localhost:3000
paths:
/query:
get:
summary: Send a Request to backend to query BabycenterDB
operationId: queryDB
tags:
- query
parameters:
- name: country
in: query
description: The country to query
required: true
schema:
type: string
- name: startDate
in: query
description: The start date of the query
required: true
schema:
type: string
format: date
- name: endDate
in: query
description: The end date of the query
required: true
schema:
type: string
format: date
- name: "keywords"
in: query
description: The list of keywords to query
required: true
schema:
type: array
items:
type: string
- name: "groups"
in: query
description: The list of groups to query
required: true
schema:
type: array
items:
type: string
- name: "numComments"
in: query
description: The number of comments to query
required: false
schema:
type: integer
format: int32
- name: "postOrComment"
in: query
description: The type of document to query, either 'posts' or 'comments'
required: true
schema:
type: string
enum: [posts, comments]
- name: "numDocuments"
in: query
description: The number of documents to return
required: true
schema:
type: integer
format: int32
responses:
'200':
description: A list of relevant posts or comments
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/PostList'
- $ref: '#/components/schemas/CommentList'
default:
description: unexpected error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
components:
schemas:
PostList:
type: array
description: A list of posts
items:
$ref: '#/components/schemas/Post'
CommentList:
type: array
description: A list of comments
items:
$ref: '#/components/schemas/Comment'
Post:
type: object
required:
- _id
- time_delta
- group
- date
- text
- url
- title
- author
- num_comments
- country
properties:
_id:
type: string
example: "a24519679"
time_delta:
type: integer
example: 0
group:
type: string
example: "pro-vaccination-support-and-info"
date:
type: string
format: date-time
example: "2010-10-01T00:00:00.000Z"
text:
type: string
example: "http://pediatrics.aappublications.org/cgi/content/full/123/1/e164"
url:
type: string
example: "https://community.babycenter.com/post/a24519679/helpful_links"
title:
type: string
example: "Helpful links"
author:
type: string
example: "rtlmom"
num_comments:
type: integer
example: 10
country:
type: string
example: "USA"
Comment:
type: object
required:
- _id
- text
- group
- date
- time_delta
- author
- post
- country
properties:
_id:
type: string
example: "63c6df57194f73dec4bd8e5d"
text:
type: string
example: "I also use a mixture of Borax and baking soda on our carpets."
group:
type: string
example: "bargain_hunters"
date:
type: string
format: date-time
example: "2021-02-09T00:00:00.000Z"
time_delta:
type: integer
example: -1
author:
type: string
example: "!shortzrules!"
post:
type: string
description: ID of the related post
example: "a77091749"
country:
type: string
example: "USA"
Error:
type: object
properties:
code:
type: integer
format: int32
message:
type: string