-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtraffic-api-swagger.yaml
259 lines (247 loc) · 5.57 KB
/
traffic-api-swagger.yaml
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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
swagger: '2.0'
info:
description: |
This API gets the Traffic Data for Metro Manila.
version: 1.0.0
title: Traffic API
termsOfService: https://github.com/ridvanbaluyos/traffic-api/blob/master/README.md#notes
contact:
name: Ridvan Baluyos
url: https://ridvanbaluyos.com
email: ridvan@baluyos.net
license:
name: MIT
url: https://opensource.org/licenses/MIT
tags:
- name: traffic
description: Metro Manila Traffic Feed
- name: highways
description: Metro Manila Major Highways
- name: segments
description: Metro Manila Segments of Major Highways
host: traffic.gundamserver.com
basePath: /v1
schemes:
- http
paths:
/feed:
get:
tags:
- traffic
summary: Fetch Metro Manila Traffic Feed
operationId: getTrafficFeed
consumes:
- application/json
produces:
- application/json
parameters:
- in: query
name: highway
description: The Highway name.
required: false
type: string
maximum: 16
minimum: 2
- in: query
name: segment
description: The Highway Segment Direction name.
required: false
type: string
maximum: 16
minimum: 2
- in: query
name: direction
description: The Highway Segment Direction name.
required: false
type: string
maximum: 2
minimum: 2
responses:
200:
description: Success
schema:
$ref: '#/definitions/Traffic'
404:
description: API Not Found
schema:
$ref: '#/definitions/ApiNotFoundResponse'
/highways:
get:
tags:
- highways
summary: Fetch Metro Manila Major Highways
operationId: getHighways
consumes:
- application/json
produces:
- application/json
responses:
200:
description: Success
schema:
$ref: '#/definitions/Highways'
404:
description: API Not Found
schema:
$ref: '#/definitions/ApiNotFoundResponse'
/segments:
get:
tags:
- segments
summary: Fetch Metro Manila Major Highway Segments
operationId: getSegments
consumes:
- application/json
produces:
- application/json
parameters:
- name: highway
in: query
description: The highway name.
required: true
type: string
responses:
200:
description: Success
schema:
$ref: '#/definitions/Segments'
404:
description: API Not Found
schema:
$ref: '#/definitions/ApiNotFoundResponse'
definitions:
MetaData:
type: object
properties:
url:
type: string
example: http://traffic.gundamserver.com/v1/feed
title:
type: string
example: Metro Manila Traffic Data
source:
type: string
example: http://mmdatraffic.interaksyon.com/livefeed/
version:
type: string
example: 1
generated:
type: integer
example: 1499242888
Traffic:
type: object
properties:
metadata:
$ref: '#/definitions/MetaData'
traffic:
type: object
properties:
<highway_name>:
$ref: '#/definitions/Highway'
Highway:
type: object
properties:
name:
type: string
example: ROXAS_BLVD
label:
type: string
example: Roxas Boulevard
segments:
$ref: '#/definitions/Segment'
Highways:
type: array
items:
type: string
example:
- EDSA
- COMMONWEALTH
- ROXAS_BLVD.
- MARCOS_HIGHWAY
- ORTIGAS
- C5
- QUEZON_AVE.
- ESPAÑA
Segment:
type: object
properties:
name:
type: string
example: COASTAL_ROAD
label:
type: string
example: Coastal Road
status:
$ref: '#/definitions/Status'
Segments:
type: array
items:
type: string
example:
- MALL_OF_ASIA
- MACAPAGAL_AVE.
- ROXAS_BOULEVARD
- F.B._HARRISON
- TAFT_AVE.
- TRAMO
- MALIBAY
- MAGALLANES
- ARNAIZ_-_PASAY_ROAD
- AYALA_AVE._SERVICE_ROAD
- AYALA_AVE.
- BUENDIA
- KALAYAAN_-_ESTRELLA
- ORENSE
- GUADALUPE
- PIONEER_-_BONI
- RELIANCE
- SHAW_BLVD._SERVICE_ROAD
- SHAW_BLVD.
- SM_MEGAMALL
- ORTIGAS_AVE._SERVICE_ROAD
- ORTIGAS_AVE.
- WHITE_PLAINS_-_CONNECTICUT
- SANTOLAN_SERVICE_ROAD
- SANTOLAN
- MAIN_AVE.
- P._TUAZON_SERVICE_ROAD
- P._TUAZON
- MC_ARTHUR_-_FARMERS_SERVICE_ROAD
- MC_ARTHUR_-_FARMERS
- AURORA_BLVD._SERVICE_ROAD
- AURORA_BLVD.
- MONTE_DE_PIEDAD
- NEW_YORK_-_NEPA_Q-MART
- KAMUNING_SERVICE_ROAD
- KAMUNING
- TIMOG_SERVICE_ROAD
- TIMOG
- NIA_ROAD
- QUEZON_AVE.
- TRINOMA
- NORTH_AVE.
- BANSALANGIN
- MUñOZ
- KAINGIN_ROAD
- BALINTAWAK
Status:
type: object
properties:
name:
type: string
example: MH
label:
type: string
example: Moderate to Heavy Traffic
last_updated:
type: string
example: Wed, 05 Jul 2017 15:50:59 +0800
ApiNotFoundResponse:
type: object
properties:
message:
type: string
example: no API found with those values
externalDocs:
description: Find out more about Swagger
url: http://swagger.io