Skip to content

Commit

Permalink
22751: add the regions definition in the info/*.json endpoints (#254)
Browse files Browse the repository at this point in the history
* 22751: add the `regions` definition in the info/*.json endpoints

* 22751: mark `region` parameter as deprecated

* 22751: added the `regions` in the operator.json result
  • Loading branch information
fersagui authored Oct 28, 2024
1 parent f22296f commit 14fe091
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 14 deletions.
49 changes: 41 additions & 8 deletions docs/specs/tripgo.openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,20 +135,27 @@ paths:
post:
tags:
- Public Transport
summary: Operators for a region
summary: Operators for a region or group of regions
description: Retrieves detailed information about covered transport service
providers for a specified region.
requestBody:
content:
application/json:
schema:
required:
- region
- regions
type: object
properties:
region:
type: string
description: Region name/code from `regions.json`.
deprecated: true
regions:
type: array
description: Region names/codes from `regions.json`.
items:
type: string
minimum: 1
modes:
type: array
description: "Public transit modes (`pt_pub_*`) for which results\
Expand Down Expand Up @@ -196,7 +203,7 @@ paths:
\ to a empty response. In order to prevent this, make sure such combinations\
\ are posible, using previously fetched information."
example:
region: US_CA_LosAngeles
regions: [US_CA_LosAngeles, US_CA_Ventura]
modes:
- pt_pub_tram
- pt_pub_bus
Expand Down Expand Up @@ -247,6 +254,11 @@ paths:
feedId:
type: string
description: unique source identifiers for this operator.
regions:
type: array
description: Regions where this operator has services
items:
type: string
hasStableID:
type: boolean
description: When true, returned operator identifier is stable between data updates.
Expand Down Expand Up @@ -288,12 +300,19 @@ paths:
application/json:
schema:
required:
- region
- regions
type: object
properties:
region:
type: string
description: Region name/code from `regions.json`.
deprecated: true
regions:
type: array
description: Region names/codes from `regions.json`.
items:
type: string
minimum: 1
query:
type: string
description: Optional search string to filter routes by their short name (complete matches only) or by their name (partial matches)
Expand Down Expand Up @@ -346,7 +365,7 @@ paths:
\ response. In order to prevent this, make sure such combinations\
\ are posible, using previously fetched information."
example:
region: US_CA_LosAngeles
region: [US_CA_LosAngeles]
operatorID: LACMTA_Rail
modes:
- pt_pub_tram
Expand Down Expand Up @@ -431,13 +450,20 @@ paths:
schema:
required:
- operatorID
- region
- regions
- routeID
type: object
properties:
region:
type: string
description: Region name/code from `regions.json`.
deprecated: true
regions:
type: array
description: Region names/codes from `regions.json`.
items:
type: string
minimum: 1
operatorID:
type: string
description: Operator ID from `info/routes.json` (or `info/operators.json`).
Expand Down Expand Up @@ -528,13 +554,20 @@ paths:
schema:
required:
- operatorID
- region
- regions
- routeID
type: object
properties:
region:
type: string
description: Region name/code from `regions.json`.
deprecated: true
regions:
type: array
description: Region names/codes from `regions.json`.
items:
type: string
minimum: 1
operatorID:
type: string
description: Operator ID from `info/routes.json` (or `info/operators.json`).
Expand Down Expand Up @@ -564,7 +597,7 @@ paths:
\ You can also retrieve information for a particular list of services\
\ using `serviceTripIDs`."
example:
region: US_CA_LosAngeles
regions: [US_CA_LosAngeles]
operatorID: LACMTA_Rail
routeID: 806
serviceTripIDs:
Expand Down
38 changes: 32 additions & 6 deletions docs/specs/tripgo.swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ paths:
region:
type: string
description: Region name/code from `regions.json`.
deprecated: true
regions:
type: array
description: List of regions. The name/code should be from `regions.json`.
items:
type: string
modes:
type: array
items:
Expand All @@ -161,9 +167,9 @@ paths:
description: Boolean if result should include full information for operator/s or just a list with all their IDs ignoring `mode` array in response.
default: false
required:
- region
- regions
example:
region: US_CA_LosAngeles
regions: [US_WI_Milwaukee,US_WI_Madison]
modes:
- pt_pub_tram
- pt_pub_bus
Expand All @@ -186,6 +192,11 @@ paths:
feedId:
type: string
description: unique source identifiers for this operator.
regions:
type: array
items:
description: Regions where this operator has services
type: string
hasStableID:
type: boolean
description: When true, returned operator identifier is stable between data updates.
Expand All @@ -207,6 +218,7 @@ paths:
example:
- id: LACMTA
name: Metro - Los Angeles
regions: [US_CA_LosAngeles]
modes:
- mode: pt_pub_tram
numberOfServices: 5698
Expand All @@ -218,11 +230,13 @@ paths:
- updates: true
- id: 27
name: LADOT
regions: [US_CA_LosAngeles]
modes:
- mode: pt_pub_bus
numberOfServices: 15828
- id: 6216179
name: Big Blue Bus
regions: [US_CA_LosAngeles]
modes:
- mode: pt_pub_bus
numberOfServices: 7702
Expand Down Expand Up @@ -252,6 +266,12 @@ paths:
region:
type: string
description: Region name/code from `regions.json`.
deprecated: true
regions:
type: array
description: List of regions. The name/code should be from `regions.json`.
items:
type: string
operatorID:
type: string
description: TSP ID from `info/operator.json`.
Expand Down Expand Up @@ -281,10 +301,10 @@ paths:
description: Boolean if result should include full information for route/s or just a list with all their IDs.
default: false
required:
- region
- regions
- operatorID
example:
region: US_CA_LosAngeles
regions: [US_CA_LosAngeles]
operatorID: LACMTA_Rail
modes:
- pt_pub_tram
Expand Down Expand Up @@ -385,6 +405,12 @@ paths:
region:
type: string
description: Region name/code from `regions.json`.
deprecated: true
regions:
type: array
description: List of regions. The name/code should be from `regions.json`.
items:
type: string
operatorID:
type: string
description: TSP ID from `info/operator.json`.
Expand All @@ -406,11 +432,11 @@ paths:
description: Boolean if result should include full information for service/s or just a list with only `id` field in response.
default: false
required:
- region
- regions
- operatorID
- routeID
example:
region: US_CA_LosAngeles
region: [US_CA_LosAngeles]
operatorID: LACMTA_Rail
routeID: 806
serviceTripIDs:
Expand Down

0 comments on commit 14fe091

Please sign in to comment.