From 929d74c3f4a28f6c47d3ebc52ac87dfc6693f235 Mon Sep 17 00:00:00 2001 From: Ahmedhossamdev Date: Fri, 16 Aug 2024 12:04:36 +0300 Subject: [PATCH] feat: add trips_for_route endpoint --- openapi.yml | 85 +++++++++++++++++++++++++++++++++++++++++++- stainless-config.yml | 6 +++- 2 files changed, 89 insertions(+), 2 deletions(-) diff --git a/openapi.yml b/openapi.yml index 835ffb9..aefad4a 100644 --- a/openapi.yml +++ b/openapi.yml @@ -13,7 +13,7 @@ paths: get: tags: - default - summary: Retrieve Agencies with Coverage + summary: Returns a list of all transit agencies currently supported by OneBusAway along with the center of their coverage area. responses: '200': description: Successful response @@ -453,6 +453,65 @@ paths: required: - data + /api/where/trips-for-route/{routeID}.json: + get: + tags: + - default + summary: Search for active trips for a specific route. + parameters: + - name: routeID + in: path + required: true + description: The ID of the route. + schema: + type: string + - name: includeStatus + in: query + required: false + description: Determine whether full tripStatus elements with real-time information are included. Defaults to false. + schema: + type: boolean + - name: includeSchedule + in: query + required: false + description: Determine whether full schedule elements are included. Defaults to false. + schema: + type: boolean + - name: time + in: query + required: false + description: Query the system at a specific time. Useful for testing. + schema: + type: integer + format: int64 + responses: + '200': + description: Successful response + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/ResponseWrapper' + - type: object + properties: + data: + type: object + properties: + limitExceeded: + type: boolean + list: + type: array + items: + $ref: '#/components/schemas/TripDetails' + references: + $ref: '#/components/schemas/Reference' + required: + - list + - limitExceeded + - references + required: + - data + /api/where/trips-for-location.json: get: summary: Retrieve trips for a given location @@ -1086,6 +1145,7 @@ components: $ref: '#/components/schemas/Reference' required: - list + - limitExceeded - references Coverage: @@ -1119,6 +1179,7 @@ components: $ref: '#/components/schemas/Reference' required: - entry + - limitExceeded - references CoverageResponse: type: object @@ -1133,6 +1194,7 @@ components: $ref: '#/components/schemas/Reference' required: - list + - limitExceeded - references CurrentTime: @@ -2038,6 +2100,23 @@ components: vehicleId: type: string description: ID of the transit vehicle currently serving the trip. + required: + - activeTripId + - blockTripSequence + - closestStop + - distanceAlongTrip + - lastKnownDistanceAlongTrip + - lastLocationUpdateTime + - lastUpdateTime + - occupancyCapacity + - occupancyCount + - occupancyStatus + - phase + - predicted + - scheduleDeviation + - serviceDate + - status + - totalDistanceAlongTrip TripDetails: type: object @@ -2054,6 +2133,10 @@ components: type: string tripId: type: string + schedule: + $ref: '#/components/schemas/TripSchedule' + status: + $ref: '#/components/schemas/TripStatus' TripSchedule: type: object diff --git a/stainless-config.yml b/stainless-config.yml index 181d73e..aad570c 100644 --- a/stainless-config.yml +++ b/stainless-config.yml @@ -8,7 +8,7 @@ organization: resources: agencies_with_coverage: methods: - retrieve: get /api/where/agencies-with-coverage.json + list: gset /api/where/agencies-with-coverage.json agency: methods: @@ -87,6 +87,10 @@ resources: methods: retrieve: get /api/where/trip-for-vehicle/{vehicleID}.json + trips_for_route: + methods: + list: get /api/where/trips-for-route/{routeID}.json + report_problem_with_stop: methods: retrieve: get /api/where/report-problem-with-stop/{stopID}.json