Skip to content

Fix schedule-for-route OpenAPI conformance: add missing Stops field #696

@aaronbrethorst

Description

@aaronbrethorst

Summary

The OpenAPI conformance test is failing for the schedule-for-route endpoint because the response is missing a Stops field that the spec requires.

FAIL: TestOpenAPIConformance_StaticEndpoints/schedule-for-route
Error: Schema violation - property "stops" is missing from schedule-for-route response

What needs to change

  1. Model (internal/models/schedule_for_route.go): Add a Stops field to the ScheduleForRouteEntry struct
  2. Handler (internal/restapi/schedule_for_route_handler.go): Populate the stops list in the response, collecting all stops referenced by the route's schedule

Existing pattern to follow

The stops_for_route_handler.go (lines ~146-199) already builds a stop list for a route — the same pattern of collecting stop IDs, querying them, and converting to model objects applies here.

Acceptance criteria

  • ScheduleForRouteEntry includes a Stops field with proper JSON tag
  • The handler populates stops from the route's schedule data
  • TestOpenAPIConformance_StaticEndpoints/schedule-for-route passes
  • Existing tests in schedule_for_route_handler_test.go continue to pass
  • make test passes
  • make lint passes

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomers to the codebase

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions