From 677510f08a43b0ce6ae6d61895ba5d6d8b5c48fa Mon Sep 17 00:00:00 2001 From: Ahmedhossamdev Date: Tue, 30 Jul 2024 17:57:04 +0300 Subject: [PATCH] chore: Update openapi.yml to include new API route for retrieving schedule for a specific stop --- openapi.yml | 142 +++++++++++++++++++++++++++++++++++++++++++ stainless-config.yml | 4 ++ 2 files changed, 146 insertions(+) diff --git a/openapi.yml b/openapi.yml index 01fedce..207636a 100644 --- a/openapi.yml +++ b/openapi.yml @@ -471,6 +471,36 @@ paths: data: $ref: '#/components/schemas/StopResponse' + /api/where/schedule-for-stop/{stopID}.json: + get: + summary: Get schedule for a specific stop + parameters: + - name: stopID + in: path + required: true + schema: + type: string + description: The stop id to request the schedule for, encoded directly in the URL + - name: date + in: query + required: false + schema: + type: string + format: date + description: The date for which you want to request a schedule in the format YYYY-MM-DD (optional, defaults to the current date) + responses: + '200': + description: Schedule information for the stop + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/ResponseWrapper' + - type: object + properties: + data: + $ref: '#/components/schemas/ScheduleForStopResponse' + /api/where/stop-ids-for-agency/{agencyID}.json: parameters: - name: agencyID @@ -1522,3 +1552,115 @@ components: type: string references: $ref: '#/components/schemas/Reference' + + ScheduleFrequency: + type: object + properties: + serviceDate: + type: integer + format: int64 + startTime: + type: integer + format: int64 + endTime: + type: integer + format: int64 + headway: + type: integer + format: int32 + serviceId: + type: string + tripId: + type: string + required: + - serviceDate + - startTime + - endTime + - headway + - serviceId + - tripId + + StopRouteDirectionSchedule: + type: object + properties: + scheduleFrequencies: + type: array + items: + $ref: '#/components/schemas/ScheduleFrequency' + scheduleStopTimes: + type: array + items: + $ref: '#/components/schemas/ScheduleStopTime' + tripHeadsign: + type: string + required: + - scheduleStopTimes + - tripHeadsign + + ScheduleStopTime: + type: object + properties: + arrivalEnabled: + type: boolean + arrivalTime: + type: integer + format: int64 + departureEnabled: + type: boolean + departureTime: + type: integer + format: int64 + serviceId: + type: string + stopHeadsign: + type: string + tripId: + type: string + required: + - arrivalEnabled + - arrivalTime + - departureEnabled + - departureTime + - serviceId + - tripId + + StopRouteSchedule: + type: object + properties: + routeId: + type: string + stopRouteDirectionSchedules: + type: array + items: + $ref: '#/components/schemas/StopRouteDirectionSchedule' + required: + - routeId + - stopRouteDirectionSchedules + + ScheduleForStopEntry: + type: object + properties: + date: + type: integer + format: int64 + stopId: + type: string + stopRouteSchedules: + type: array + items: + $ref: '#/components/schemas/StopRouteSchedule' + required: + - date + - stopId + - stopRouteSchedules + + ScheduleForStopResponse: + type: object + properties: + entry: + $ref: '#/components/schemas/ScheduleForStopEntry' + references: + $ref: '#/components/schemas/Reference' + required: + - entry + - references diff --git a/stainless-config.yml b/stainless-config.yml index f01c036..db61eef 100644 --- a/stainless-config.yml +++ b/stainless-config.yml @@ -42,6 +42,10 @@ resources: methods: list: get /api/where/stop-ids-for-agency/{agencyID}.json + schedule_for_stop: + methods: + retrieve: get /api/where/schedule-for-stop/{stopID}.json + route: methods: retrieve: get /api/where/route/{routeID}.json