onebusaway-application-modules icon indicating copy to clipboard operation
onebusaway-application-modules copied to clipboard

Add documentation for URL field, publicationWindows in service alerts (situation elements)

Open barbeau opened this issue 9 years ago • 2 comments

There is an undocumented url and publicationWindows fields in situation elements. For example, see http://buseta.wmata.com/onebusaway-api-webapp/api/where/arrivals-and-departures-for-stop/1_18090.json?minutesAfter=65&app_ver=71&key=v1_BktoDJ2gJlu6nLM6LsT9H8IUbWc%3DcGF1bGN3YXR0c0BnbWFpbC5jb20%3D.

situations: [
{
activeWindows: [ ],
allAffects: [],
consequences: [
{
condition: "significant_delays",
conditionDetails: null
}
],
creationTime: 1472224980000,
description: {
lang: "en",
value: "Impacts of SafeTrack Surge #9 on Metrobus Customers"
},
id: "1_261B7F0A8A68F37591996B11D5C5CED3",
publicationWindows: [ ],
reason: "UNKNOWN_CAUSE",
severity: "unknown",
summary: {
lang: "en",
value: "Impacts of SafeTrack Surge #9 on Metrobus Customers"
},
url: null // <-- This will include a URL with more details, if the agency populates that field
},

These fields aren't reflected in the current REST API docs: http://developer.onebusaway.org/modules/onebusaway-application-modules/current/api/where/elements/situation.html

We should add documentation for these field (and describe how publicationWindows is different from activeWindows).

Related issues - https://github.com/OneBusAway/onebusaway-application-modules/issues/181, https://github.com/OneBusAway/onebusaway-android/issues/710.

cc @sheldonabrown

barbeau avatar Oct 26 '16 13:10 barbeau

Here's the populated URL field:

...
summary: {
lang: "en",
value: "Impacts of SafeTrack Surge #9 on Metrobus Customers"
},
url: {
lang: "en",
value: "http://www.wmata.com/rider_tools/metro_service_status/advisories.cfm?AID=5749"
}

barbeau avatar Oct 26 '16 15:10 barbeau

Here is how OBA Android interprets url field:

A URL to a human-readable website with more details on the alert

This is in-line with the GTFS Realtime Alert.url definition at https://github.com/google/transit/blob/master/gtfs-realtime/spec/en/reference.md#message-alert which is:

The URL which provides additional information about the alert.

OBA Android doesn't use publicationWindows so I'm not sure how that should be used and how it differs from activeWindows.

barbeau avatar Jun 24 '21 18:06 barbeau