-
Notifications
You must be signed in to change notification settings - Fork 5
/
nager-date.yaml
382 lines (382 loc) · 10.8 KB
/
nager-date.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
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
openapi: 3.0.1
info:
title: Nager.Date API - V3
description: Nager.Date is open source software. If you would like to support the project you can award a GitHub star ⭐ or much better <a href='https://github.com/sponsors/nager'>start a sponsorship</a>
contact:
name: Nager.Date on GitHub
url: https://github.com/nager/Nager.Date
license:
name: MIT License
url: https://github.com/nager/Nager.Date/blob/master/LICENSE.md
version: v3
servers:
- url: https://date.nager.at
paths:
/api/v3/CountryInfo/{countryCode}:
get:
tags:
- Country
summary: Get country info for the given country
operationId: CountryCountryInfo
parameters:
- name: countryCode
in: path
description: ""
required: true
schema:
type: string
responses:
"200":
description: Success
content:
text/plain:
schema:
$ref: "#/components/schemas/CountryInfoDto"
application/json:
schema:
$ref: "#/components/schemas/CountryInfoDto"
text/json:
schema:
$ref: "#/components/schemas/CountryInfoDto"
/api/v3/AvailableCountries:
get:
tags:
- Country
summary: Get all available countries
operationId: CountryAvailableCountries
responses:
"200":
description: Success
content:
text/plain:
schema:
type: array
items:
$ref: "#/components/schemas/CountryV3Dto"
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/CountryV3Dto"
text/json:
schema:
type: array
items:
$ref: "#/components/schemas/CountryV3Dto"
/api/v3/LongWeekend/{year}/{countryCode}:
get:
tags:
- LongWeekend
summary: Get long weekends for a given country
operationId: LongWeekendLongWeekend
parameters:
- name: year
in: path
description: ""
required: true
schema:
type: integer
format: int32
- name: countryCode
in: path
description: ""
required: true
schema:
type: string
responses:
"200":
description: Success
content:
text/plain:
schema:
type: array
items:
$ref: "#/components/schemas/LongWeekendV3Dto"
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/LongWeekendV3Dto"
text/json:
schema:
type: array
items:
$ref: "#/components/schemas/LongWeekendV3Dto"
/api/v3/PublicHolidays/{year}/{countryCode}:
get:
tags:
- PublicHoliday
summary: Get public holidays
operationId: PublicHolidayPublicHolidaysV3
parameters:
- name: year
in: path
description: ""
required: true
schema:
type: integer
format: int32
- name: countryCode
in: path
description: ""
required: true
schema:
type: string
responses:
"200":
description: Public holidays
content:
text/plain:
schema:
type: array
items:
$ref: "#/components/schemas/PublicHolidayV3Dto"
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/PublicHolidayV3Dto"
text/json:
schema:
type: array
items:
$ref: "#/components/schemas/PublicHolidayV3Dto"
"400":
description: Validation failure
"404":
description: CountryCode is unknown
/api/v3/IsTodayPublicHoliday/{countryCode}:
get:
tags:
- PublicHoliday
summary: Is today a public holiday
description: "The calculation is made on the basis of UTC time to adjust the time please use the offset.<br />\r\nThis is a special endpoint for `curl`<br /><br />\r\n200 = Today is a public holiday<br />\r\n204 = Today is not a public holiday<br /><br />\r\n`STATUSCODE=$(curl --silent --output /dev/stderr --write-out \"%{http_code}\" https://date.nager.at/Api/v2/IsTodayPublicHoliday/AT)`<br /><br />\r\n`if [ $STATUSCODE -ne 200 ]; then # error handling; fi`"
operationId: PublicHolidayIsTodayPublicHoliday
parameters:
- name: countryCode
in: path
description: ""
required: true
schema:
type: string
- name: countyCode
in: query
description: ""
schema:
type: string
- name: offset
in: query
description: utc timezone offset
schema:
maximum: 12
minimum: -12
type: integer
format: int32
default: 0
responses:
"200":
description: Today is a public holiday
"204":
description: Today is not a public holiday
"400":
description: Validation failure
"404":
description: CountryCode is unknown
/api/v3/NextPublicHolidays/{countryCode}:
get:
tags:
- PublicHoliday
summary: Returns the upcoming public holidays for the next 365 days for the given country
operationId: PublicHolidayNextPublicHolidays
parameters:
- name: countryCode
in: path
required: true
schema:
type: string
responses:
"200":
description: Success
content:
text/plain:
schema:
type: array
items:
$ref: "#/components/schemas/PublicHolidayV3Dto"
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/PublicHolidayV3Dto"
text/json:
schema:
type: array
items:
$ref: "#/components/schemas/PublicHolidayV3Dto"
/api/v3/NextPublicHolidaysWorldwide:
get:
tags:
- PublicHoliday
summary: Returns the upcoming public holidays for the next 7 days
operationId: PublicHolidayNextPublicHolidaysWorldwide
responses:
"200":
description: Success
content:
text/plain:
schema:
type: array
items:
$ref: "#/components/schemas/PublicHolidayV3Dto"
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/PublicHolidayV3Dto"
text/json:
schema:
type: array
items:
$ref: "#/components/schemas/PublicHolidayV3Dto"
/api/v3/Version:
get:
tags:
- Version
summary: Get version of the used Nager.Date library
operationId: VersionGetVersion
responses:
"200":
description: Success
content:
text/plain:
schema:
$ref: "#/components/schemas/VersionInfoDto"
application/json:
schema:
$ref: "#/components/schemas/VersionInfoDto"
text/json:
schema:
$ref: "#/components/schemas/VersionInfoDto"
components:
schemas:
CountryInfoDto:
type: object
properties:
commonName:
type: string
description: CommonName
nullable: true
officialName:
type: string
description: OfficialName
nullable: true
countryCode:
type: string
description: CountryCode
nullable: true
region:
type: string
description: Region
nullable: true
borders:
type: array
items:
$ref: "#/components/schemas/CountryInfoDto"
description: Country Borders
nullable: true
additionalProperties: false
description: CountryInfo Dto
CountryV3Dto:
type: object
properties:
countryCode:
type: string
nullable: true
name:
type: string
nullable: true
additionalProperties: false
description: Country
LongWeekendV3Dto:
type: object
properties:
startDate:
type: string
description: StartDate
format: date-time
endDate:
type: string
description: EndDate
format: date-time
dayCount:
type: integer
description: DayCount
format: int32
needBridgeDay:
type: boolean
description: NeedBridgeDay
additionalProperties: false
description: Long Weekend
PublicHolidayType:
enum:
- Public
- Bank
- School
- Authorities
- Optional
- Observance
type: string
PublicHolidayV3Dto:
type: object
properties:
date:
type: string
description: The date
format: date
localName:
type: string
description: Local name
nullable: true
name:
type: string
description: English name
nullable: true
countryCode:
type: string
description: ISO 3166-1 alpha-2
nullable: true
fixed:
type: boolean
description: Is this public holiday every year on the same date
global:
type: boolean
description: Is this public holiday in every county (federal state)
counties:
type: array
items:
type: string
description: ISO-3166-2 - Federal states
nullable: true
launchYear:
type: integer
description: The launch year of the public holiday
format: int32
nullable: true
types:
type: array
items:
$ref: "#/components/schemas/PublicHolidayType"
description: A list of types the public holiday it is valid
nullable: true
additionalProperties: false
description: Public Holiday
VersionInfoDto:
type: object
properties:
name:
type: string
nullable: true
version:
type: string
nullable: true
additionalProperties: false