Description
While reviewing the route-ids-for-agency endpoint against the OneBusAway specification, we found that the Go implementation replicates a legacy Java defect.
When a requested agency is not found, the handler currently returns an HTTP 200 OK with a null body. According to the spec (Extension 4a / Suspected Defects), the intended behavior is to return an HTTP 404 error.
Additionally, the existing unit test TestInvalidAgencyIdForRouteIds is incorrectly written to assert this defective 200 + null behavior instead of the specified 404 behavior.
Current Behavior
- Handler uses
api.sendNull(w, r) resulting in a 200 status with null.
TestInvalidAgencyIdForRouteIds asserts http.StatusOK.
Expected Behavior (Spec Compliance)
- Handler should use
api.sendNotFound(w, r) to return a standard 404 envelope.
- The test should be updated to assert
http.StatusNotFound and the appropriate error code/text.
Proof

Description
While reviewing the
route-ids-for-agencyendpoint against the OneBusAway specification, we found that the Go implementation replicates a legacy Java defect.When a requested agency is not found, the handler currently returns an HTTP 200 OK with a
nullbody. According to the spec (Extension 4a / Suspected Defects), the intended behavior is to return an HTTP 404 error.Additionally, the existing unit test
TestInvalidAgencyIdForRouteIdsis incorrectly written to assert this defective200 + nullbehavior instead of the specified404behavior.Current Behavior
api.sendNull(w, r)resulting in a200status withnull.TestInvalidAgencyIdForRouteIdsassertshttp.StatusOK.Expected Behavior (Spec Compliance)
api.sendNotFound(w, r)to return a standard 404 envelope.http.StatusNotFoundand the appropriate error code/text.Proof