-
Notifications
You must be signed in to change notification settings - Fork 0
/
car-park.swagger.yaml
359 lines (344 loc) · 9.3 KB
/
car-park.swagger.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
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
swagger: "2.0"
info:
version: 0.1.0
title: Car parks
x-logo:
url: "https://developer.tripgo.com/img/tripgo-api-logo-color.svg"
description:
Work-in-progress proposal for car park operators to connect their services to SkedGo's platform.
paths:
/carparks:
get:
description: |
Provides a list of all car parks (regardless of whether they are currently available or not), including optionally (but highly recommended!) information on prices. Required method.
responses:
200:
description: Successful response
schema:
type: array
items:
$ref: '#/definitions/CarParkInfo'
definitions:
RGBColor:
properties:
red:
type: integer
minimum: 0
maximum: 255
blue:
type: integer
minimum: 0
maximum: 255
green:
type: integer
minimum: 0
maximum: 255
required:
- red
- blue
- green
ImageObject:
description: Image stored remotely
externalDocs:
url: "http://schema.org/ImageObject"
properties:
caption:
type: string
description: The caption for this object
contentUrl:
type: string
description: URL to download image
fileFormat:
type: string
description: Media type of image
externalDocs:
url: "http://schema.org/fileFormat"
width:
type: integer
description: Width in pixels
height:
type: integer
description: Height in pixels
required:
- contentUrl
CarParkInfo:
externalDocs:
url: 'https://fiware-datamodels.readthedocs.io/en/latest/Parking/OffStreetParking/doc/spec/index.html'
properties:
id:
type: string
name:
type: string
description: Car park name
externalDocs:
url: "http://schema.org/name"
address:
type: string
externalDocs:
url: "http://schema.org/address"
coordinates:
$ref: '#/definitions/GeoCoordinates'
provider:
$ref: '#/definitions/CompanyInfo'
totalSpotNumber:
description: Static information of total spaces
type: integer
avalableSpotNumber:
description: Real-time information of total spaces
type: integer
timestamp:
type: string
format: date-time
description: Timestamp `availableSpotNumber` got recorded in ISO8601 format
openingHours:
type: array
items:
$ref: '#/definitions/OpeningHours'
example:
- ["Mo-Fr 06:30-21:00", "Sa 08:00-14:00"]
pricingTable:
description: The pricing schemas used. Free is assummed if this array is empty.
type: array
items:
$ref: '#/definitions/PricingTable'
restrictions:
$ref: '#/definitions/Restrictions'
entrances:
type: array
items:
$ref: '#/definitions/Entrance'
source:
$ref: '#/definitions/DataSourceAttribution'
info:
type: string
description: Additional information about this car park
maxHeightInMetres:
type: number
minimum: 0
description: Maximum height allowed
link:
type: string
description: Specific URL which identifies this car park
avalability:
$ref: '#/definitions/RealtimeStatus'
required:
- id
- coordinates
- name
OpeningHours:
type: string
description: Opening times period
externalDocs:
url: "http://schema.org/openingHours"
example:
- "Mo-Su" # all week
- "Mo-Fr" # all day from Mondays to Fridays
- "Mo-Su 08:00-21:00" # all week from 8:00 to 21:00
- "Tu,Th 08:00-12:00" # Tuesdays and Thursdays from 8:00 to 12:00
GeoCoordinates:
description: The geographic coordinates of a place or event.
externalDocs:
url: "http://schema.org/GeoCoordinates"
properties:
latitude:
type: number
description: Latitude information
longitude:
type: number
description: Longitude information
address:
type: string
description: Physical address of the item.
# other fields that could be added:
# - addressCountry
# - postalcode
# - elevation
required:
- latitude
- longitude
CompanyInfo:
externalDocs:
url: 'https://schema.org/provider'
properties:
name:
type: string
address:
type: string
phone:
type: string
website:
type: string
logos:
type: array
items:
$ref: '#/definitions/ImageObject'
color:
$ref: '#/definitions/RGBColor'
required:
- name
DataSourceAttribution:
description:
Information on how data should get attributed. When present, this needs to get displayed on relevant screens / views.
properties:
provider:
$ref: '#/definitions/CompanyInfo'
disclaimer:
type: string
description: Longer disclaimer that should be displayed for this provider
required:
- provider
PricingTable:
properties:
title:
type: string
description: descriptive fare title
category:
type: string
description: additional informatinon in case this pricing applies to a specif group, like 'DISABLED'.
times:
$ref: '#/definitions/OpeningHours'
freeDuringOutHours:
type: boolean
description: if true, pricing is free when car park is closed.
currency:
type: string
prices:
type: array
items:
$ref: '#/definitions/Price'
required:
- times
- currency
- prices
example:
times: 06:00 - 22:00
title: Regular fare
currency: AUD
prices:
- maxDurationInMinutes: 60
amount: 20
- type: time
maxDurationInMinutes: 120
amount: 32
- type: additional
maxDurationInMinutes: 60
amount: 10
- type: daytime
amount: 56
Price:
type: object
properties:
type:
type: string
description: Fare type. Could be 'time' based or not. The 'additional' type refers to additional minutes defined on $maxDurationInMinutes
enum: [time, additional, daytime, minimum, maximun, evening, overnight]
amount:
type: number
description: price in local curreny.
maxDurationInMinutes:
type: integer
minimum: 0
description: maximun duration for this price in minutes
extraArgs:
type: string
description: additional information which chould be needed.
required:
- amount
Restrictions:
description: Information about the car park restrictions.
properties:
maxStayInMinutes:
description: Maximun stay time in minutes
type: integer
minimum: 0
noRestrictionWhenClosed:
description: If this is `true`, the restrictions applies only during the time zone defined in `openingHours`
type: boolean
allowedOnly:
description: Only the vehicles which satisfy these requirements could stay
type: array
items:
type: string
enum:
- SUBSCRIBERS
- VISITORS
- CUSTOMERS
- PERMIT_HOLDERS
- EVENTS
- VALET
- DISABLED
- COACH
- MOTORCYCLES
notAllowed:
description: The vehicle types which are not allowed to stay
type: array
items:
type: string
enum:
- SUVS
- LPG_CARS
example:
maxStayInMinutes: 120
noRestrictionWhenClosed: true
allowedOnly: CUSTOMERS
Entrance:
description: Information about the car park entrance.
properties:
type:
description: Entrance type identifier
type: string
enum:
- ENTRANCE_EXIT
- ENTRANCE_ONLY
- EXIT_ONLY
- PEDESTRIAN
- DISABLED_PEDESTRIAN
- PERMIT
address:
type: string
lat:
type: number
description: Latitude
lng:
type: number
description: Longitude
required:
- type
- lat
- lng
RealtimeStatus:
description: Realtime status information.
properties:
isOpen:
type: boolean
description: true if car park is open today.
totalSpaces:
type: integer
minimum: 0
description: Parking spots which could be used.
availableSpaces:
type: integer
minimum: 0
description: Available parking spots which are free now.
opens:
type: string
description: Opening time.
closes:
type: string
description: Closing time.
lastUpdated:
type: string
format: date-time
description: Last updated time in ISO 8601 format.
source:
$ref: '#/definitions/CompanyInfo'
required:
- availableSpaces
- lastUpdated
example:
- isOpen: true
lastUpdated: '2018-05-23T12:52:02Z'
opens: '00:00'
availableSpaces: 19
totalSpaces": 61
closes: '24:00'