Skip to content

routes-for-location: references.situations must be empty #1396

Description

@ARCoder181105

Summary

routes-for-location returns service alerts in data.references.situations. The spec gives this endpoint exactly one populated reference array, agencies.

Current behaviour

routesForLocationHandler collects alerts for every returned route and writes them into references.situations (internal/restapi/routes_for_location_handler.go:82-84).

This came from a change that swept every non-trip handler at once, not from a decision about this endpoint.

Verified against the deployed OneBusAway server on identical live data. Alert 1_92239 selects route 1_100016 with no stop or trip restriction — the only alert shape that reaches maglev's by-route index. At a stop on that route, both servers return routes 1_100016 and 1_100017:

situations
Deployed OBA []
maglev ['1_92239']

Spec requirement

routes-for-location, Response Structure:

data.references — Object containing referenced entities. For this endpoint only agencies is populated; all other arrays (routes, stops, trips, stopTimes, situations) are present but empty.

Route objects carry no situation IDs, so a caller has nothing to resolve a situation against.

Acceptance criteria

  • data.references.situations is always empty, including when an alert affects a route in data.list
  • data.list and data.references.agencies are unchanged
  • includeReferences=false still empties agencies
  • A test asserts situations stay empty with an alert present on a returned route

Scope note

Only route-only alerts ever reached this path — alerts naming both a route and a stop never enter the by-route index (internal/gtfs/realtime.go:682), so output is unchanged for them. The other five BuildSituationReferences callers listed in #1377 are out of scope here.

Metadata

Metadata

Assignees

Labels

spec-gapGap found between spec and implementation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions