This repository was archived by the owner on Jun 29, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathspec.yml
More file actions
215 lines (215 loc) · 5.59 KB
/
Copy pathspec.yml
File metadata and controls
215 lines (215 loc) · 5.59 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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
openapi: "3.0.0"
info:
title: Tide Predictions API
version: "1.0.0"
description: An API to find the nearest tide prediction station and get predictions for the next few days.
contact:
name: Tide Predictions API
url: https://github.com/bdougherty/tide-predictions
tags:
- name: stations
- name: predictions
servers:
- url: "https://tide-predictions.now.sh"
description: Production API Server
- url: "http://localhost:{port}"
description: Dev API Server
variables:
port:
default: "3000"
paths:
/all:
get:
summary: Get a list of all available prediction stations.
description: Does not include any predictions.
operationId: getAllStations
tags:
- stations
responses:
200:
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/Stations"
/near/{lat},{lon}:
get:
summary: Find the 10 closest prediction stations to the specified latitude and longitude.
description: Includes predictions for yesterday, today, and the next 2 days for each station.
operationId: getStationsNearPosition
tags:
- stations
- predictions
parameters:
- $ref: '#/components/parameters/lat'
- $ref: '#/components/parameters/lon'
responses:
200:
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/StationsWithPredictions"
404:
$ref: "#/components/responses/Error"
/closest/{lat},{lon}:
get:
summary: Find the closest prediction station to the specified latitude and longitude.
description: Includes predictions for yesterday, today, and the next 7 days.
operationId: getStationClosestToPosition
tags:
- stations
- predictions
parameters:
- $ref: '#/components/parameters/lat'
- $ref: '#/components/parameters/lon'
responses:
200:
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/StationWithPredictions"
404:
$ref: "#/components/responses/Error"
/{id}:
get:
summary: Get tide predictions for a specific station.
description: Includes predictions for yesterday, today, and the next 7 days.
operationId: getStation
tags:
- stations
- predictions
parameters:
- $ref: '#/components/parameters/stationId'
responses:
200:
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/StationWithPredictions"
404:
$ref: "#/components/responses/Error"
components:
parameters:
lat:
name: lat
in: path
required: true
description: The latitude of the location to use.
schema:
$ref: "#/components/schemas/Latitude"
lon:
name: lon
in: path
required: true
description: The longitude of the location to use.
schema:
$ref: "#/components/schemas/Longitude"
stationId:
name: id
in: path
required: true
description: The ID of the station.
schema:
type: string
responses:
Error:
description: "Error"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
schemas:
Latitude:
type: number
minimum: -90
maximum: 90
example: -74.4771
Longitude:
type: number
minimum: -180
maximum: 180
example: 39.3426
Prediction:
properties:
type:
type: string
enum:
- "high"
- "low"
height:
type: number
format: float
example: 3.598
time:
type: string
format: date-time
example: "2018-02-11T04:41:00-05:00"
unixTime:
type: number
format: timestamp
example: 1518342060
Stations:
properties:
stations:
type: array
items:
type: object
$ref: "#/components/schemas/Station"
StationsWithPredictions:
properties:
stations:
type: array
items:
type: object
$ref: "#/components/schemas/StationWithPredictions"
Station:
properties:
id:
type: string
example: "8534836"
name:
type: string
example: "Longport (Inside), Great Egg Harbor Inlet"
commonName:
type: string
example: "Longport, Risely Channel"
lat:
$ref: "#/components/schemas/Latitude"
lon:
$ref: "#/components/schemas/Longitude"
state:
type: string
example: "NJ"
region:
type: string
example: "Outer Coast"
timeZone:
type: string
example: "America/New_York"
distance:
type: number
format: float
example: 0
type:
type: string
enum:
- "harmonic"
- "subordinate"
StationWithPredictions:
allOf:
- $ref: "#/components/schemas/Station"
- type: object
properties:
predictions:
type: array
items:
type: object
$ref: "#/components/schemas/Prediction"
Error:
properties:
message:
type: string
example: "Not Found"