|
20 | 20 | ], |
21 | 21 | "responses": { |
22 | 22 | "200": { |
23 | | - "description": "{success: true, data: [Alert]}", |
| 23 | + "description": "{\"success\": true, \"data\": [Alert]}", |
24 | 24 | "schema": { |
25 | 25 | "$ref": "#/definitions/Alert" |
26 | 26 | } |
|
37 | 37 | ], |
38 | 38 | "responses": { |
39 | 39 | "200": { |
40 | | - "description": "{success: true, data: [BusStop]}", |
| 40 | + "description": "{\"success\": true, \"data\": [BusStop]}", |
41 | 41 | "schema": { |
42 | 42 | "$ref": "#/definitions/BusStop" |
43 | 43 | } |
44 | 44 | } |
45 | 45 | } |
46 | 46 | } |
47 | 47 | }, |
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.", |
51 | 52 | "produces": [ |
52 | 53 | "application/json" |
53 | 54 | ], |
54 | 55 | "parameters": [ |
55 | 56 | { |
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}]", |
67 | 60 | "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 | + } |
70 | 81 | } |
71 | 82 | ], |
72 | 83 | "responses": { |
73 | 84 | "200": { |
74 | | - "description": "{success: true, data: {delay: int64}}" |
| 85 | + "description": "{\"success\": true, \"data\": [{\"tripID\": string, \"stopID\": string, \"delay\": int}]}" |
75 | 86 | } |
76 | 87 | } |
77 | 88 | } |
|
132 | 143 | ], |
133 | 144 | "responses": { |
134 | 145 | "200": { |
135 | | - "description": "{success: true, data: {fromStop: [Route], boardingSoon: [Route], walking: [Route]}}", |
| 146 | + "description": "{\"success\": true, \"data\": {fromStop: [Route], boardingSoon: [Route], walking: [Route]}}", |
136 | 147 | "schema": { |
137 | 148 | "$ref": "#/definitions/Route" |
138 | 149 | } |
|
175 | 186 | ], |
176 | 187 | "responses": { |
177 | 188 | "200": { |
178 | | - "description": "{success: true}" |
| 189 | + "description": "{\"success\": true}" |
179 | 190 | } |
180 | 191 | } |
181 | 192 | } |
|
211 | 222 | ], |
212 | 223 | "responses": { |
213 | 224 | "200": { |
214 | | - "description": "{success: true, data: [BusStop/ApplePlace]}", |
| 225 | + "description": "{\"success\": true, data: [BusStop/ApplePlace]}", |
215 | 226 | "schema": { |
216 | 227 | "$ref": "#/definitions/BusStop" |
217 | 228 | } |
|
227 | 238 | }, |
228 | 239 | "/tracking": { |
229 | 240 | "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).", |
231 | 242 | "produces": [ |
232 | 243 | "application/json" |
233 | 244 | ], |
234 | 245 | "parameters": [ |
235 | 246 | { |
236 | 247 | "in": "body", |
237 | 248 | "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}]", |
239 | 250 | "required": true, |
240 | 251 | "schema": { |
241 | 252 | "type": "array", |
242 | 253 | "items": { |
243 | 254 | "type": "object", |
244 | 255 | "required": [ |
245 | | - "stopID", |
246 | 256 | "routeID", |
247 | | - "tripIdentifiers" |
| 257 | + "tripID" |
248 | 258 | ], |
249 | 259 | "properties": { |
250 | | - "stopID": { |
251 | | - "type": "string", |
252 | | - "example": "1511" |
253 | | - }, |
254 | 260 | "routeID": { |
255 | 261 | "type": "integer", |
256 | 262 | "example": "10" |
257 | 263 | }, |
258 | | - "tripIdentifiers": { |
| 264 | + "tripID": { |
259 | 265 | "type": "string", |
260 | 266 | "example": "t536-b67-s1B" |
261 | 267 | } |
|
266 | 272 | ], |
267 | 273 | "responses": { |
268 | 274 | "200": { |
269 | | - "description": "{success: true, data: [BusLocation]}", |
| 275 | + "description": "{\"success\": true, \"data\": [BusLocation]}", |
270 | 276 | "schema": { |
271 | 277 | "$ref": "#/definitions/BusLocation" |
272 | 278 | } |
|
350 | 356 | } |
351 | 357 | } |
352 | 358 | }, |
353 | | - "BusLocation": { |
| 359 | + "ApplePlace": { |
354 | 360 | "type": "object", |
355 | 361 | "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": { |
379 | 363 | "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" |
385 | 366 | }, |
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" |
389 | 371 | }, |
390 | 372 | "name": { |
391 | 373 | "type": "string", |
392 | | - "example": "1602" |
| 374 | + "example": "Saigon Kitchen", |
| 375 | + "description": "The name of the place." |
393 | 376 | }, |
394 | | - "destination": { |
| 377 | + "detail": { |
395 | 378 | "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." |
402 | 381 | }, |
403 | | - "commStatus": { |
| 382 | + "type": { |
404 | 383 | "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 |
412 | 395 | }, |
413 | | - "lastUpdated": { |
| 396 | + "congestionLevel": { |
414 | 397 | "type": "integer", |
415 | | - "example": 1555441212000 |
| 398 | + "example": 0 |
416 | 399 | }, |
417 | | - "gpsStatus": { |
418 | | - "type": "integer", |
419 | | - "example": 2 |
| 400 | + "latitude": { |
| 401 | + "type": "double", |
| 402 | + "example": 42.459849543945 |
420 | 403 | }, |
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 |
425 | 407 | }, |
426 | | - "direction": { |
| 408 | + "routeID": { |
427 | 409 | "type": "string", |
428 | | - "description": "Unknown. Could be NB or I.", |
429 | | - "example": "NB" |
| 410 | + "example": 77 |
430 | 411 | }, |
431 | | - "routeID": { |
432 | | - "type": "integer", |
433 | | - "example": 82 |
| 412 | + "speed": { |
| 413 | + "type": "double", |
| 414 | + "example": 0.0 |
434 | 415 | }, |
435 | | - "vehicleID": { |
| 416 | + "timestamp": { |
436 | 417 | "type": "integer", |
437 | | - "example": 1602 |
| 418 | + "example": 1586033827 |
438 | 419 | }, |
439 | 420 | "tripID": { |
440 | | - "type": "integer", |
441 | | - "example": 1450 |
| 421 | + "type": "string", |
| 422 | + "example": "t677-b73-slF" |
442 | 423 | } |
443 | 424 | } |
444 | 425 | }, |
|
578 | 559 | } |
579 | 560 | } |
580 | 561 | }, |
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 | | - }, |
611 | 562 | "Route": { |
612 | 563 | "type": "object", |
613 | 564 | "properties": { |
|
0 commit comments