-
Notifications
You must be signed in to change notification settings - Fork 15
/
swagger.json
503 lines (503 loc) · 13.8 KB
/
swagger.json
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
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
{
"openapi": "3.0.0",
"info": {
"description": "banidb-api docs",
"version": "1",
"title": "banidb-api"
},
"servers": [
{
"url": "",
"description": "live endpoint"
}
],
"paths": {
"/health": {
"get": {
"summary": "Health check",
"description": "Make sure api is up and running",
"responses": {
"200": {
"description": "successful operation"
}
}
}
},
"/search/{query}": {
"get": {
"summary": "Search",
"description": "Enter a search query and get lines that match.",
"parameters": [
{
"name": "query",
"in": "path",
"description": "Search query",
"required": true,
"type": "string"
},
{
"name": "searchtype",
"in": "query",
"description": "Type of search. { 0: First letter each word from start (Gurmukhi), 1: First letter each word anywhere (Gurmukhi), 2: Full Word (Gurmukhi), 3: Full Word Translation (English), 4: Romanized Gurmukhi (English), 5: Ang, 6: Main Letter (Gurmukhi), 7: Romanized first letter anywhere (English) }",
"required": false,
"schema": {
"$ref": "#/definitions/SearchType"
}
},
{
"name": "source",
"in": "query",
"description": "Source to search in. { G: Guru Granth Sahib Ji, D: Dasam Granth Sahib, B: Bhai Gurdas Ji Vaaran, A: Amrit Keertan, S: Bhai Gurdas Singh Ji Vaaran, N: Bhai Nand Lal Ji Vaaran, R: Rehatnamas & Panthic Sources, all: All sources }",
"required": false,
"schema": {
"$ref": "#/definitions/Source"
}
},
{
"name": "ang",
"in": "query",
"description": "Which ang to return. Required if searchtype is 5",
"required": false,
"type": "number"
},
{
"name": "raag",
"in": "query",
"description": "Which raag to limit search to.",
"required": false,
"type": "number"
},
{
"name": "writer",
"in": "query",
"description": "Which writer to limit search to.",
"required": false,
"type": "number"
},
{
"name": "page",
"in": "query",
"description": "Pagination param. Which results page to return",
"required": false,
"type": "number"
},
{
"name": "results",
"in": "query",
"description": "Pagination param. How many results per page to return.",
"required": false,
"type": "number"
}
],
"responses": {
"200": {
"description": "successful operation"
}
}
}
},
"/shabads/{shabadID}": {
"get": {
"summary": "Shabads by ID",
"description": "Get an entire Shabad from its shabadID. More than one shabadID can be specificed with operators '+' or ','",
"parameters": [
{
"name": "shabadID",
"in": "path",
"description": "Shabad id(s)",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "successful operation"
},
"400": {
"description": "Malformed URL"
}
}
}
},
"/angs/{pageNo}/{sourceID}": {
"get": {
"summary": "Ang",
"description": "Get an entire Ang(s) by number and optional source. More than one Ang can be specificed with operators '+' and '-'",
"parameters": [
{
"name": "pageNo",
"in": "path",
"description": "Ang number or range(s). Examples: '1', '2-3', '4+6', '2-3+7', '1-4+7-9' ",
"required": true,
"type": "string"
},
{
"name": "sourceID",
"in": "path",
"description": "Source to search in. Defaults of G when omitted. { G: Guru Granth Sahib Ji, D: Dasam Granth Sahib, B: Bhai Gurdas Ji Vaaran, A: Amrit Keertan, S: Bhai Gurdas Singh Ji Vaaran N: Bhai Nand Lal Ji Vaaran, R: Rehatnamas & Panthic Sources }",
"required": false,
"schema": {
"$ref": "#/definitions/AngSources"
}
}
],
"responses": {
"200": {
"description": "successful operation"
},
"400": {
"description": "Malformed URL"
}
}
}
},
"/hukamnamas/{year}/{month}/{day}": {
"get": {
"summary": "Hukamnama",
"description": "Get the Hukamnama from Sri Harmandir Sahib.",
"parameters": [
{
"name": "year",
"in": "path",
"description": "Year for specific date of Hukamnama. Required if month and day are specified.",
"required": false,
"type": "string"
},
{
"name": "month",
"in": "path",
"description": "Month for specific date of Hukamnama. Required if year and day are specified.",
"required": false,
"type": "string"
},
{
"name": "day",
"in": "path",
"description": "Day for specific date of Hukamnama. Required if year and month are specified.",
"required": false,
"type": "string"
}
]
},
"responses": {
"200": {
"description": "successful operation"
},
"404": {
"description": "Please specify a valid date. Archives go back to 2002-01-01"
}
}
},
"/random/{sourceID}": {
"get": {
"summary": "Retrieve a random Shabad",
"description": "Get Randomly selected Shabad.",
"parameters": [
{
"name": "sourceID",
"in": "path",
"description": "Source to search in. Defaults of G when omitted. { G: Guru Granth Sahib Ji, D: Dasam Granth Sahib, B: Bhai Gurdas Ji Vaaran, A: Amrit Keertan, S: Bhai Gurdas Singh Ji Vaaran, N: Bhai Nand Lal Ji Vaaran, R: Rehatnamas & Panthic Sources, all: All sources }",
"required": false,
"schema": {
"$ref": "#/definitions/Source"
}
}
],
"responses": {
"200": {
"description": "successful operation"
},
"400": {
"description": "Malformed URL"
}
}
}
},
"/banis": {
"get": {
"summary": "Banis List",
"description": "Get a list of banis found in sundar gutka.",
"responses": {
"200": {
"description": "successful operation"
}
}
}
},
"/banis/{baniID}": {
"get": {
"summary": "Bani",
"description": "Get a specific bani found in sundar gutka by baniID.",
"parameters": [
{
"name": "baniID",
"in": "path",
"description": "Bani ID",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "successful operation"
}
}
}
},
"/amritkeertan": {
"get": {
"summary": "Amrit Keertan List",
"description": "Get a list of all headers found in Amrit Keertan.",
"responses": {
"200": {
"description": "successful operation"
}
}
}
},
"/amritkeertan/index": {
"get": {
"summary": "Amrit Keertan List",
"description": "Get a list of all indexes found in Amrit Keertan.",
"responses": {
"200": {
"description": "successful operation"
}
}
}
},
"/amritkeertan/index/{headerID}": {
"get": {
"summary": "Amrit Keertan List",
"description": "Get a list of all indexes found in Amrit Keertan for a specific header.",
"parameters": [
{
"name": "headerID",
"in": "path",
"description": "Header id",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "successful operation"
}
}
}
},
"/amritkeertan/shabads/{shabadID}": {
"get": {
"summary": "Amrit Keertan List",
"description": "Get shabads found in Amrit Keertan by number",
"parameters": [
{
"name": "shabadID",
"in": "path",
"description": "Shabad id",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "successful operation"
}
}
}
},
"/kosh/{letter}": {
"get": {
"summary": "Kosh letter",
"description": "Get words in kosh table by letter.",
"parameters": [
{
"name": "letter",
"in": "path",
"description": "letter",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "successful operation"
}
}
}
},
"/kosh/word/{word}": {
"get": {
"summary": "Kosh word",
"description": "Get words in kosh table by word.",
"parameters": [
{
"name": "word",
"in": "path",
"description": "word to partial match",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "successful operation"
}
}
}
},
"/kosh/search/{query}": {
"get": {
"summary": "Kosh Search",
"description": "Get words in kosh table by query.",
"parameters": [
{
"name": "query",
"in": "path",
"description": "query to search on",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "successful operation"
}
}
}
},
"/rehats": {
"get": {
"summary": "Rehat Maryadas list",
"description": "Get a list of rehat maryads that are provided by BaniDB.",
"responses": {
"200": {
"description": "successful operation"
}
}
}
},
"/rehats/{rehatID}": {
"get": {
"summary": "Rehat Maryada chapters",
"description": "Get the chapters for a specific rehat maryada found in by rehatID.",
"parameters": [
{
"name": "rehatID",
"in": "path",
"description": "Rehat ID",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "successful operation"
}
}
}
},
"/rehats/{rehatID}/chapters/{chapterID}": {
"get": {
"summary": "Rehat Maryada chapter contents",
"description": "Get the chapter contents for a specific chapter by chapterID of a specific rehat maryada found by rehatID.",
"parameters": [
{
"name": "rehatID",
"in": "path",
"description": "Rehat ID",
"required": true,
"type": "string"
},
{
"name": "chapterID",
"in": "path",
"description": "Chapter ID",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "successful operation"
}
}
}
},
"/rehats/search/{query}": {
"get": {
"summary": "Rehat Maryada search",
"description": "Enter a search query and get chapters from rehats that match.",
"parameters": [
{
"name": "query",
"in": "path",
"description": "Query string",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "successful operation"
}
}
}
},
"/writers": {
"get": {
"summary": "Writers meta-data",
"description": "Get writers available to be used for search endpoint.",
"responses": {
"200": {
"description": "successful operation"
}
}
}
},
"/raags": {
"get": {
"summary": "Raags meta-data",
"description": "Get raags available to be used for search endpoint.",
"responses": {
"200": {
"description": "successful operation"
}
}
}
},
"/sources": {
"get": {
"summary": "Sources meta-data",
"description": "Get sources available to be used for search endpoint.",
"responses": {
"200": {
"description": "successful operation"
}
}
}
}
},
"definitions": {
"SearchType": {
"type": "number",
"enum": [0, 1, 2, 3, 4, 5, 6, 7]
},
"AngSources": {
"type": "string",
"enum": ["G", "D", "B", "A", "S", "N", "R"]
},
"Source": {
"type": "string",
"enum": ["G", "D", "B", "A", "S", "N", "R", "all"]
},
"Sabad": {
"type": "object",
"properties": {
"shabadInfo": {
"type": "string"
}
}
}
}
}