-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi3.yml
More file actions
192 lines (190 loc) · 5.64 KB
/
Copy pathopenapi3.yml
File metadata and controls
192 lines (190 loc) · 5.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# SPDX-FileCopyrightText: NOI Techpark <digital@noi.bz.it>
#
# SPDX-License-Identifier: CC0-1.0
openapi: 3.0.3
info:
title: Open Data Hub GTFS API
description: >
API to retrieve GTFS files, related metadata, and GTFS-RT realtime feeds.
termsOfService: https://docs.opendatahub.com/en/latest/licenses.html#apis-terms-of-service
contact:
name: Open Data Hub
url: https://opendatahub.com
email: help@opendatahub.com
license:
name: API License
url: https://docs.opendatahub.com/en/latest/licenses.html
version: V1
servers:
- url: __API_BASE_URL__/v1
paths:
/dataset:
get:
summary: Get all available datasets
responses:
200:
description: List of dataset metadata
content:
application/json:
schema:
$ref: "#/components/schemas/dataset-map"
/dataset/{datasetId}:
get:
summary: Get metadata of specific dataset by ID
parameters:
- $ref: "#/components/parameters/datasetId"
responses:
200:
description: List of dataset metadata
content:
application/json:
schema:
$ref: "#/components/schemas/dataset"
400:
description: Invalid dataset ID
/dataset/{datasetId}/raw:
get:
summary: Download the raw GTFS (.zip) file
parameters:
- $ref: "#/components/parameters/datasetId"
responses:
200:
description: Raw GTFS file
x-is-file: true
content:
application/zip:
schema:
type: string
format: binary
400:
description: Invalid dataset ID
/realtime:
get:
summary: List all datasets with realtime feeds
responses:
200:
description: Map of datasets that have realtime feeds
content:
application/json:
schema:
$ref: "#/components/schemas/realtime-dataset-map"
/realtime/{datasetId}/{feedType}:
get:
summary: Get a realtime feed
description: >
Returns the GTFS-RT feed data. Format is negotiated via Accept header
(application/json or application/x-protobuf). Defaults to JSON.
parameters:
- $ref: "#/components/parameters/datasetId"
- name: feedType
in: path
required: true
description: Type of GTFS-RT feed
schema:
type: string
enum: [trip-updates, vehicle-positions, service-alerts]
responses:
200:
description: GTFS-RT feed data
content:
application/json:
schema:
type: object
description: GTFS-RT feed in JSON format
application/x-protobuf:
schema:
type: string
format: binary
404:
description: Dataset or feed type not found
406:
description: Requested format not available for this feed
components:
parameters:
datasetId:
name: datasetId
in: path
required: true
description: Dataset ID, as returned in the /v1/dataset/ call
schema:
type: string
schemas:
dataset-map:
type: object
description: Map of datasets by ID (id, dataset). `skyalps-flight-data` and `sta-time-tables` are example IDs
properties:
skyalps-flight-data:
$ref: "#/components/schemas/dataset"
sta-time-tables:
$ref: "#/components/schemas/dataset"
ummadumm-data:
$ref: "#/components/schemas/dataset"
dataset:
type: object
description: Metadata of a GTFS dataset
properties:
description:
type: string
description: A short description of the dataset
endpoint:
type: string
format: uri
description: URL to download the raw GTFS file
origin:
type: string
description: The provider of the dataset
license:
type: string
description: License under which the dataset is published
metadata:
type: object
description: A free form JSON object that may contain additional metadata
additionalProperties: true
realtime:
$ref: "#/components/schemas/realtime-links"
realtime-dataset-map:
type: object
description: Map of datasets that have realtime feeds
additionalProperties:
$ref: "#/components/schemas/realtime-dataset"
realtime-dataset:
type: object
description: Realtime feed metadata for a dataset
properties:
dataset_id:
type: string
description: The associated dataset ID
static_dataset:
type: string
format: uri
description: URL to the static GTFS dataset metadata
static_gtfs:
type: string
format: uri
description: URL to download the static GTFS file
feeds:
type: object
description: Available realtime feed URLs
properties:
trip_updates:
type: string
format: uri
vehicle_positions:
type: string
format: uri
service_alerts:
type: string
format: uri
realtime-links:
type: object
description: Links to available realtime feeds, present only when the dataset has RT feeds
properties:
trip_updates:
type: string
format: uri
vehicle_positions:
type: string
format: uri
service_alerts:
type: string
format: uri