forked from dev-magdy/Shreyash-specs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrest-countries.yml
338 lines (337 loc) · 9.48 KB
/
rest-countries.yml
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
openapi: 3.0.1
servers:
- url: https://restcountries.com
info:
title: rest-countries
description: |
Get information about countries via a RESTful API. Countries information is returned with the fields below. You can choose which fields are returned by passing a comma-separated string in the fields. for example "name,status,continents"
1. name
2. tld
3. cca2
4. ccn3
5. cca3
6. cioc
7. independent
8. status
9. unMember
10. currencies
11. idd
12. capital
13. altSpellings
14. region
15. subregion
16. languages
17. translations
18. latlng
19. landlocked
20. borders
21. area
22. demonyms
23. flag
24. maps
25. population
26. gini
27. fifa
28. car
29. timezones
30. continents
31. flags
32. coatOfArms
33. startOfWeek
34. capitalInfo
35. postalCode.
contact:
name: Alejandro Matos
url: https://restcountries.com
license:
name: Mozilla Public License MPL 2.0
url: https://www.mozilla.org/en-US/MPL/2.0/
version: '3.1'
paths:
/v3.1/all:
get:
operationId: getAllCountries
description: "Get a list of all the countries and their details. This includes all fields like population, timezones, currency, continents and others."
parameters:
- name: fields
in: query
required: true
schema:
type: string
responses:
default:
description: getAllCountries default response
content:
application/json:
schema:
$ref: '#/components/schemas/RestCountries'
/v3.1/alpha/{alphacode}:
get:
operationId: getByAlpha
description: "Search by cca2, ccn3, cca3 or cioc country code. Example US."
parameters:
- name: alphacode
in: path
required: true
description: "cca2, ccn3, cca3 or cioc country code"
schema:
type: string
- name: fields
in: query
description: list of comma separated fields to return
schema:
type: string
responses:
default:
description: getByAlpha default response
content:
application/json:
schema:
$ref: '#/components/schemas/RestCountries'
/v3.1/alpha/:
get:
operationId: getByAlphaList
description: Get a list of one or more countries using their country codes
parameters:
- name: codes
in: query
required: true
description: list of comma separated cca2, ccn3, cca3 or cioc country code
schema:
type: string
- name: fields
in: query
description: list of comma separated fields to return
schema:
type: string
responses:
default:
description: getByAlphaList default response
content:
application/json:
schema:
$ref: '#/components/schemas/RestCountries'
/v3.1/currency/{currency}:
get:
operationId: getByCurrency
description: Find a country/countries that use a common currency using the ISO 4217 currency code e.g. gbp, usd
parameters:
- name: currency
in: path
required: true
schema:
type: string
description: Currency code
- name: fields
in: query
description: list of comma separated fields to return
schema:
type: string
responses:
default:
description: getByCurrency default response
content:
application/json:
schema:
$ref: '#/components/schemas/RestCountries'
/v3.1/name/{name}:
get:
operationId: getByName
description: Get a country by its name e.g France
parameters:
- name: name
in: path
required: true
description: Name of the country
schema:
type: string
- name: fullText
in: query
description: Indicates if the name should be matched fully by text or to be searched. Set true to match the name exactly and false for search.
schema:
type: boolean
- name: fields
in: query
description: list of comma separated fields to return
schema:
type: string
responses:
default:
description: getByName default response
content:
application/json:
schema:
$ref: '#/components/schemas/RestCountries'
/v3.1/capital/{capital}:
get:
operationId: getByCapital
description: Get a country by its capital city/state
parameters:
- name: capital
in: path
required: true
schema:
type: string
- name: fields
description: list of comma separated fields to return
in: query
schema:
type: string
responses:
default:
description: getByCapital default response
content:
application/json:
schema:
$ref: '#/components/schemas/RestCountries'
/v3.1/region/{region}:
get:
operationId: getByRegion
description: Get countries in a specific region e.g Europe
parameters:
- name: region
in: path
required: true
description: Region name
schema:
type: string
enum:
- Africa
- Americas
- Asia
- Europe
- Oceania
- name: fields
in: query
description: list of comma separated fields to return
schema:
type: string
responses:
default:
description: getByRegion default response
content:
application/json:
schema:
$ref: '#/components/schemas/RestCountries'
/v3.1/subregion/{subregion}:
get:
operationId: getBySubRegion
description: Get countries in a subregion e.g Nothern Europe
parameters:
- name: subregion
description: The name of the subregion
in: path
required: true
schema:
type: string
- name: fields
description: list of comma separated fields to return
in: query
schema:
type: string
responses:
default:
description: getBySubRegion default response
content:
application/json:
schema:
$ref: '#/components/schemas/RestCountries'
/v3.1/lang/{lang}:
get:
operationId: getByLanguage
description: Get a list of countries by ISO 639-2/T 3 letter language code or language name
parameters:
- name: lang
description: the language e.g. spanish or spa
in: path
required: true
schema:
type: string
- name: fields
description: list of comma separated fields to return
in: query
schema:
type: string
responses:
default:
description: getByLanguage default response
content:
application/json:
schema:
$ref: '#/components/schemas/RestCountries'
/v3.1/demonym/{demonym}:
get:
operationId: getByDemonym
description: Get country from demonym e.g. american, french
parameters:
- name: demonym
in: path
description: Demonym e.g. canadian, american
required: true
schema:
type: string
- name: fields
description: list of comma separated fields to return
in: query
schema:
type: string
responses:
default:
description: getByDemonym default response
content:
application/json:
schema:
$ref: '#/components/schemas/RestCountries'
/v3.1/translation/{translation}:
get:
operationId: getByTranslation
description: Get a country by its translated name e.g. alemania for germany
parameters:
- name: translation
in: path
description: Country name in a different language e.g. alemania
required: true
schema:
type: string
- name: fields
description: list of comma separated fields to return
in: query
schema:
type: string
responses:
default:
description: getByTranslation default response
content:
application/json:
schema:
$ref: '#/components/schemas/RestCountries'
/v3.1/independent:
get:
operationId: getIndependentCountries
description: Get a list of all independent countries
parameters:
- name: status
in: query
required: true
schema:
type: boolean
- name: fields
in: query
required: true
schema:
type: string
responses:
default:
description: getIndependentCountries default response
content:
application/json:
schema:
$ref: '#/components/schemas/RestCountries'
components:
schemas:
RestCountries:
type: array
items:
$ref: '#/components/schemas/RestCountry'
RestCountry:
type: object