Skip to content

Commit

Permalink
feat: add trips_for_route endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmedhossamdev committed Aug 16, 2024
1 parent b4b7c0b commit 929d74c
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 2 deletions.
85 changes: 84 additions & 1 deletion openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1086,6 +1145,7 @@ components:
$ref: '#/components/schemas/Reference'
required:
- list
- limitExceeded
- references

Coverage:
Expand Down Expand Up @@ -1119,6 +1179,7 @@ components:
$ref: '#/components/schemas/Reference'
required:
- entry
- limitExceeded
- references
CoverageResponse:
type: object
Expand All @@ -1133,6 +1194,7 @@ components:
$ref: '#/components/schemas/Reference'
required:
- list
- limitExceeded
- references

CurrentTime:
Expand Down Expand Up @@ -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
Expand All @@ -2054,6 +2133,10 @@ components:
type: string
tripId:
type: string
schedule:
$ref: '#/components/schemas/TripSchedule'
status:
$ref: '#/components/schemas/TripStatus'

TripSchedule:
type: object
Expand Down
6 changes: 5 additions & 1 deletion stainless-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 929d74c

Please sign in to comment.