REST API - Test Output With Situations

41 views
Skip to first unread message

webm...@rideschedules.com

unread,
Feb 22, 2015, 2:36:17 PM2/22/15
to onebusa...@googlegroups.com
Hello,

Anyway to get sample responses that include situations in vehicle locations or stop prediction requests?

I tried using the time parameter but the results exclude references.

I would like to validate code paths that handle situations, but so far I have been unable to locate response data to do so. 

Finally, can anyone say if situations are currently in use or planned?


Cookie Guru

unread,
Feb 23, 2015, 10:30:30 AM2/23/15
to onebusa...@googlegroups.com

> Finally, can anyone say if situations are currently in use or planned?

In Puget Sound, no. I can't speak for the other regions

Sean Barbeau

unread,
Feb 24, 2015, 9:35:40 AM2/24/15
to onebusa...@googlegroups.com
You should see active situations for a stop returned in the arrivals-and-departures-for-stop API method, as part of the tripStatus element, which is contained in the arrivalAndDeparture element:
http://developer.onebusaway.org/modules/onebusaway-application-modules/current/api/where/methods/arrivals-and-departures-for-stop.html
http://developer.onebusaway.org/modules/onebusaway-application-modules/current/api/where/elements/arrival-and-departure.html
http://developer.onebusaway.org/modules/onebusaway-application-modules/current/api/where/elements/trip-status.html

situations are used in the OBA Tampa deployment (http://tampa.onebusaway.org/), but only in case of emergencies, which aren't often.

I'd suggest mocking a response that includes the situation to test.  I thought we had one of these for a unit test in OBA Android, but just looking at our code apparently we don't.  But, I was able to grab a sample response from a test server that includes a situation, and I've opened an issue on OBA Android to include a test for this, and put the full text of the response (JSON) there:
https://github.com/OneBusAway/onebusaway-android/issues/214

So, hopefully that helps!

Sean
Reply all
Reply to author
Forward
0 new messages