Line 0
Link Here
|
|
|
1 |
{ |
2 |
"swagger": "2.0", |
3 |
"info": { |
4 |
"title": "Koha REST API", |
5 |
"version": "0.1", |
6 |
"license": { |
7 |
"name": "GPL v3", |
8 |
"url": "http://www.gnu.org/licenses/gpl.txt" |
9 |
}, |
10 |
"contact": { |
11 |
"name": "Koha Team", |
12 |
"url": "http://koha-community.org/" |
13 |
} |
14 |
}, |
15 |
"basePath": "/", |
16 |
"paths": { |
17 |
"/borrowers": { |
18 |
"get": { |
19 |
"x-mojo-controller": "Koha::REST::Borrowers", |
20 |
"operationId": "listBorrowers", |
21 |
"produces": [ |
22 |
"application/json" |
23 |
], |
24 |
"responses": { |
25 |
"200": { |
26 |
"description": "A list of borrowers", |
27 |
"schema": { |
28 |
"type": "array", |
29 |
"items": { |
30 |
"$ref": "#/definitions/borrower" |
31 |
} |
32 |
} |
33 |
} |
34 |
} |
35 |
} |
36 |
}, |
37 |
"/borrowers/{borrowernumber}": { |
38 |
"get": { |
39 |
"x-mojo-controller": "Koha::REST::Borrowers", |
40 |
"operationId": "getBorrower", |
41 |
"parameters": [ |
42 |
{ |
43 |
"$ref": "#/parameters/borrowernumberPathParam" |
44 |
} |
45 |
], |
46 |
"produces": [ |
47 |
"application/json" |
48 |
], |
49 |
"responses": { |
50 |
"200": { |
51 |
"description": "A borrower", |
52 |
"schema": { |
53 |
"$ref": "#/definitions/borrower" |
54 |
} |
55 |
}, |
56 |
"404": { |
57 |
"description": "Borrower not found", |
58 |
"schema": { |
59 |
"$ref": "#/definitions/error" |
60 |
} |
61 |
} |
62 |
} |
63 |
} |
64 |
} |
65 |
}, |
66 |
"definitions": { |
67 |
"borrower": { |
68 |
"type": "object", |
69 |
"properties": { |
70 |
"borrowernumber": { |
71 |
"description": "Borrower internal identifier" |
72 |
}, |
73 |
"cardnumber": { |
74 |
"description": "library assigned ID number for borrowers" |
75 |
}, |
76 |
"surname": { |
77 |
"description": "borrower's last name" |
78 |
}, |
79 |
"firstname": { |
80 |
"description": "borrower's first name" |
81 |
} |
82 |
} |
83 |
}, |
84 |
"error": { |
85 |
"type": "object", |
86 |
"properties": { |
87 |
"error": { |
88 |
"description": "Error message", |
89 |
"type": "string" |
90 |
} |
91 |
} |
92 |
} |
93 |
}, |
94 |
"parameters": { |
95 |
"borrowernumberPathParam": { |
96 |
"name": "borrowernumber", |
97 |
"in": "path", |
98 |
"description": "Internal borrower identifier", |
99 |
"required": "true", |
100 |
"type": "integer" |
101 |
} |
102 |
} |
103 |
} |