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