-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsights-api-doc.yaml
281 lines (270 loc) · 7.01 KB
/
sights-api-doc.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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
openapi: 3.0.0
info:
description: |
This documentation gives a detailed specification of Sights
API, that offers management features for interesting viewpoints
in the city of Lisbon and serves the Sights android application.
version: "1.0.0"
title: Sights API
contact:
email: valter.nep@gmail.com
servers:
# Added by API Auto Mocking Plugin
- description: SwaggerHub API Auto Mocking
url: https://virtserver.swaggerhub.com/Vnepomuceno/sights-api/1.0.0
- url: 'https://sights.swagger.io/v2'
tags:
- name: sights
description: Information about available Sights
- name: users
description: Information about users of the Sigths android application
- name: feedback
description: Provide feedback about Sights android application
paths:
'/sights':
post:
tags:
- sights
summary: Add a new Sight
operationId: addSight
responses:
'201':
description: Created
content:
application/json:
schema:
type: string
example: "52d7bf7d723e8e0b0cc09138"
'400':
description: Bad request
requestBody:
$ref: '#/components/requestBodies/ManageSight'
get:
tags:
- sights
summary: Lists all Sights
operationId: listSights
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/SightsOverviewArray'
'/sights/{sightId}':
get:
tags:
- sights
summary: Fetch details about a Sight
parameters:
- in: path
name: sightId
schema:
type: string
format: uuid
required: true
description: Id of the Sight
operationId: getSight
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Sight'
put:
tags:
- sights
summary: Replace an existing Sight
parameters:
- in: path
name: sightId
schema:
type: string
format: uuid
required: true
description: Id of the Sight
operationId: editSight
responses:
'200':
description: Success
requestBody:
$ref: '#/components/requestBodies/ManageSight'
'/sights/{sightId}/rate':
post:
tags:
- sights
summary: Submits a rating for a Sight
parameters:
- in: path
name: sightId
schema:
type: string
format: uuid
required: true
description: ID of the Sight
operationId: rateSight
responses:
'204':
description: No content
requestBody:
$ref: '#/components/requestBodies/RateSight'
'/sights/{sightId}/favorite':
post:
tags:
- sights
summary: Submits a favorite for a Sight
parameters:
- in: path
name: sightId
schema:
type: string
format: uuid
required: true
description: ID of the Sight
operationId: favoriteSight
responses:
'204':
description: No content
'/users/{userId}':
get:
tags:
- users
summary: Fetch details about a user
parameters:
- in: path
name: userId
schema:
type: string
format: uuid
required: true
description: ID of the user
operationId: getUser
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/User'
'/feedback':
post:
tags:
- feedback
summary: Provide feedback about application
operationId: createFeedback
responses:
'201':
description: Created
content:
application/json:
schema:
type: string
example: "59be524946d94a68bc10b7fdf446be22"
requestBody:
$ref: '#/components/requestBodies/CreateFeedback'
components:
schemas:
Sight:
type: object
properties:
id:
type: string
format: uuid
base:
type: string
example: "http://tourism.citysdk.cm-lisboa.pt/pois/"
citySdkId:
type: string
example: "52d7bf7d723e8e0b0cc09138"
SightOverview:
type: object
properties:
id:
type: string
format: uuid
name:
type: string
example: "Miradouro do Jardim Botânico da Ajuda"
distanceFromUserInMeters:
type: integer
example: 3700
userArrivesInMinutes:
type: integer
example: 20
rating:
type: number
example: 4.5
favorites:
type: integer
example: 18
SightsOverviewArray:
type: array
items:
$ref: '#/components/schemas/SightOverview'
ManageSight:
type: object
properties:
base:
type: string
example: "http://tourism.citysdk.cm-lisboa.pt/pois/"
citySdkId:
type: string
example: "52d7bf7d723e8e0b0cc09138"
RateSight:
type: object
properties:
rating:
type: integer
example: 3
User:
type: object
properties:
id:
type: string
example: "67e8715a37a945cab72bcc34db08674f"
username:
type: string
example: "vnepomuceno"
email:
type: string
example: "valter.nep@sights.com"
Feedback:
type: object
properties:
userId:
type: string
example: "abd1582b5e00496aa1aa926b2dfedcc7"
title:
type: string
example: "Provide app in Barcelona"
description:
type: string
example: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc ullamcorper elit in mollis condimentum. Nunc lacus massa, condimentum vitae quam quis, interdum lacinia leo. Maecenas suscipit metus ut erat finibus semper."
requestBodies:
ManageSight:
content:
application/json:
schema:
$ref: '#/components/schemas/ManageSight'
description: Sight object
required: true
RateSight:
content:
application/json:
schema:
$ref: '#/components/schemas/RateSight'
description: Rate Sight object
required: true
CreateFeedback:
content:
application/json:
schema:
$ref: '#/components/schemas/Feedback'
description: Create feedback object
required: true
securitySchemes:
api_key:
type: apiKey
name: api_key
in: header