Skip to content

Commit 2bc2f8a

Browse files
authored
Update swagger (#293)
1 parent 3ef2c86 commit 2bc2f8a

1 file changed

Lines changed: 80 additions & 129 deletions

File tree

src/swagger.json

Lines changed: 80 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
],
2121
"responses": {
2222
"200": {
23-
"description": "{success: true, data: [Alert]}",
23+
"description": "{\"success\": true, \"data\": [Alert]}",
2424
"schema": {
2525
"$ref": "#/definitions/Alert"
2626
}
@@ -37,41 +37,52 @@
3737
],
3838
"responses": {
3939
"200": {
40-
"description": "{success: true, data: [BusStop]}",
40+
"description": "{\"success\": true, \"data\": [BusStop]}",
4141
"schema": {
4242
"$ref": "#/definitions/BusStop"
4343
}
4444
}
4545
}
4646
}
4747
},
48-
"/delay": {
49-
"get": {
50-
"summary": "Returns the bus delay for a bus at a specific stop",
48+
"/delays": {
49+
"post": {
50+
"summary": "Return a list of bus delays for buses at a specific stop",
51+
"description": "Takes in a list of objects with fields routeID and trip ID and returns a list of objects with fields routeID, tripID, and delay.",
5152
"produces": [
5253
"application/json"
5354
],
5455
"parameters": [
5556
{
56-
"name": "stopID",
57-
"in": "query",
58-
"description": "ex. 1113",
59-
"required": true,
60-
"type": "string",
61-
"example": "\"1113\""
62-
},
63-
{
64-
"name": "tripID",
65-
"in": "query",
66-
"description": "ex. t536-b67-slB",
57+
"in": "body",
58+
"name": "body",
59+
"description": "The stop information to get the delay in seconds for. The request body has only one field, data, which is an array of objects with the following fields: \n* stopID: The unique bus stop identifier. \n* tripID: The unique trip identifier for the specific `routeID`.\n Ex. {\"data\": [{\"stopID\": string, \"tripID\": string}]",
6760
"required": true,
68-
"type": "string",
69-
"example": "\"t536-b67-slB\""
61+
"schema": {
62+
"type": "array",
63+
"items": {
64+
"type": "object",
65+
"required": [
66+
"stopID",
67+
"tripID"
68+
],
69+
"properties": {
70+
"stopID": {
71+
"type": "string",
72+
"example": "2406"
73+
},
74+
"tripID": {
75+
"type": "string",
76+
"example": "t536-b67-s1B"
77+
}
78+
}
79+
}
80+
}
7081
}
7182
],
7283
"responses": {
7384
"200": {
74-
"description": "{success: true, data: {delay: int64}}"
85+
"description": "{\"success\": true, \"data\": [{\"tripID\": string, \"stopID\": string, \"delay\": int}]}"
7586
}
7687
}
7788
}
@@ -132,7 +143,7 @@
132143
],
133144
"responses": {
134145
"200": {
135-
"description": "{success: true, data: {fromStop: [Route], boardingSoon: [Route], walking: [Route]}}",
146+
"description": "{\"success\": true, \"data\": {fromStop: [Route], boardingSoon: [Route], walking: [Route]}}",
136147
"schema": {
137148
"$ref": "#/definitions/Route"
138149
}
@@ -175,7 +186,7 @@
175186
],
176187
"responses": {
177188
"200": {
178-
"description": "{success: true}"
189+
"description": "{\"success\": true}"
179190
}
180191
}
181192
}
@@ -211,7 +222,7 @@
211222
],
212223
"responses": {
213224
"200": {
214-
"description": "{success: true, data: [BusStop/ApplePlace]}",
225+
"description": "{\"success\": true, data: [BusStop/ApplePlace]}",
215226
"schema": {
216227
"$ref": "#/definitions/BusStop"
217228
}
@@ -227,35 +238,30 @@
227238
},
228239
"/tracking": {
229240
"post": {
230-
"summary": "Return a list information about live bus locations.",
241+
"summary": "Return a list information about live bus information (to help draw buses on the map).",
231242
"produces": [
232243
"application/json"
233244
],
234245
"parameters": [
235246
{
236247
"in": "body",
237248
"name": "body",
238-
"description": "The user's search query for a bus stop or place.\n* stopID: The unique identifier for a bus stop.\n* routeID: The number of the bus route.\n* tripIdentifiers: The array of unique trip identifiers for the specific `routeID`.",
249+
"description": "The bus information to get the live location and other relevant vehicle data from. The request body has only one field, data, which is an array of objects with the following fields: \n* routeID: The number of the bus route.\n* tripID: The unique trip identifier for the specific `routeID`.\n Ex. {\"data\": [{\"routeID\": string, \"tripID\": string}]",
239250
"required": true,
240251
"schema": {
241252
"type": "array",
242253
"items": {
243254
"type": "object",
244255
"required": [
245-
"stopID",
246256
"routeID",
247-
"tripIdentifiers"
257+
"tripID"
248258
],
249259
"properties": {
250-
"stopID": {
251-
"type": "string",
252-
"example": "1511"
253-
},
254260
"routeID": {
255261
"type": "integer",
256262
"example": "10"
257263
},
258-
"tripIdentifiers": {
264+
"tripID": {
259265
"type": "string",
260266
"example": "t536-b67-s1B"
261267
}
@@ -266,7 +272,7 @@
266272
],
267273
"responses": {
268274
"200": {
269-
"description": "{success: true, data: [BusLocation]}",
275+
"description": "{\"success\": true, \"data\": [BusLocation]}",
270276
"schema": {
271277
"$ref": "#/definitions/BusLocation"
272278
}
@@ -350,95 +356,70 @@
350356
}
351357
}
352358
},
353-
"BusLocation": {
359+
"ApplePlace": {
354360
"type": "object",
355361
"properties": {
356-
"delay": {
357-
"type": "integer",
358-
"description": "delay in seconds, could be null",
359-
"example": 4
360-
},
361-
"lastStop": {
362-
"type": "string",
363-
"example": "Highland @ Lakeland"
364-
},
365-
"case": {
366-
"type": "string",
367-
"description": "‘noData’ - means the bus for the trip does not support live tracking. ‘validData’ - means we have all the proper tracking info. ‘invalidData’ - means the trip is too far in the future. No bus has been assigned it yet.",
368-
"example": "validData"
369-
},
370-
"displayStatus": {
371-
"type": "string",
372-
"example": "On Time"
373-
},
374-
"speed": {
375-
"type": "integer",
376-
"example": 23
377-
},
378-
"latitude": {
362+
"lat": {
379363
"type": "double",
380-
"example": 42.457631999999997
381-
},
382-
"opStatus": {
383-
"type": "string",
384-
"example": "ONTIME"
364+
"description": "The latitude coordinate of the place.",
365+
"example": "42.441701090621599"
385366
},
386-
"runID": {
387-
"type": "integer",
388-
"example": 5053
367+
"long": {
368+
"type": "double",
369+
"description": "The longitude coordinate of the place.",
370+
"example": "-76.485410928726196"
389371
},
390372
"name": {
391373
"type": "string",
392-
"example": "1602"
374+
"example": "Saigon Kitchen",
375+
"description": "The name of the place."
393376
},
394-
"destination": {
377+
"detail": {
395378
"type": "string",
396-
"description": "The final destination of the bus.",
397-
"example": "Cornell-Mall, Cornell-Downtown"
398-
},
399-
"heading": {
400-
"type": "integer",
401-
"example": 270
379+
"example": "College Ave, Ithaca, NY, United States",
380+
"description": "The address of the place."
402381
},
403-
"commStatus": {
382+
"type": {
404383
"type": "string",
405-
"description": "Unknown, some sort of communication status.",
406-
"example": "GOOD"
407-
},
408-
"longitude": {
409-
"type": "number",
410-
"format": "double",
411-
"example": -76.467818
384+
"example": "applePlace",
385+
"description": "This is just the string 'applePlace'."
386+
}
387+
}
388+
},
389+
"BusLocation": {
390+
"type": "object",
391+
"properties": {
392+
"bearing": {
393+
"type": "double",
394+
"example": 266.0
412395
},
413-
"lastUpdated": {
396+
"congestionLevel": {
414397
"type": "integer",
415-
"example": 1555441212000
398+
"example": 0
416399
},
417-
"gpsStatus": {
418-
"type": "integer",
419-
"example": 2
400+
"latitude": {
401+
"type": "double",
402+
"example": 42.459849543945
420403
},
421-
"deviation": {
422-
"type": "integer",
423-
"description": "Unknown. Could be 0, 1, or 2.",
424-
"example": 0
404+
"longitude": {
405+
"type": "double",
406+
"example": -76.55484845435
425407
},
426-
"direction": {
408+
"routeID": {
427409
"type": "string",
428-
"description": "Unknown. Could be NB or I.",
429-
"example": "NB"
410+
"example": 77
430411
},
431-
"routeID": {
432-
"type": "integer",
433-
"example": 82
412+
"speed": {
413+
"type": "double",
414+
"example": 0.0
434415
},
435-
"vehicleID": {
416+
"timestamp": {
436417
"type": "integer",
437-
"example": 1602
418+
"example": 1586033827
438419
},
439420
"tripID": {
440-
"type": "integer",
441-
"example": 1450
421+
"type": "string",
422+
"example": "t677-b73-slF"
442423
}
443424
}
444425
},
@@ -578,36 +559,6 @@
578559
}
579560
}
580561
},
581-
"ApplePlace": {
582-
"type": "object",
583-
"properties": {
584-
"lat": {
585-
"type": "double",
586-
"description": "The latitude coordinate of the place.",
587-
"example": "42.441701090621599"
588-
},
589-
"long": {
590-
"type": "double",
591-
"description": "The longitude coordinate of the place.",
592-
"example": "-76.485410928726196"
593-
},
594-
"name": {
595-
"type": "string",
596-
"example": "Saigon Kitchen",
597-
"description": "The name of the place."
598-
},
599-
"detail": {
600-
"type": "string",
601-
"example": "College Ave, Ithaca, NY, United States",
602-
"description": "The address of the place."
603-
},
604-
"type": {
605-
"type": "string",
606-
"example": "applePlace",
607-
"description": "This is just the string 'applePlace'."
608-
}
609-
}
610-
},
611562
"Route": {
612563
"type": "object",
613564
"properties": {

0 commit comments

Comments
 (0)