Bug 13799: Change 'required' value type from string to boolean
[koha.git] / api / v1 / swagger.json
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": "/api/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           "403": {
36             "description": "Access forbidden",
37             "schema": {
38               "$ref": "#/definitions/error"
39             }
40           }
41         }
42       }
43     },
44     "/borrowers/{borrowernumber}": {
45       "get": {
46         "x-mojo-controller": "Koha::REST::V1::Borrowers",
47         "operationId": "getBorrower",
48         "tags": ["borrowers"],
49         "parameters": [
50           {
51             "$ref": "#/parameters/borrowernumberPathParam"
52           }
53         ],
54         "produces": [
55           "application/json"
56         ],
57         "responses": {
58           "200": {
59             "description": "A borrower",
60             "schema": {
61               "$ref": "#/definitions/borrower"
62             }
63           },
64           "403": {
65             "description": "Access forbidden",
66             "schema": {
67               "$ref": "#/definitions/error"
68             }
69           },
70           "404": {
71             "description": "Borrower not found",
72             "schema": {
73               "$ref": "#/definitions/error"
74             }
75           }
76         }
77       }
78     }
79   },
80   "definitions": {
81     "borrower": {
82       "type": "object",
83       "properties": {
84         "borrowernumber": {
85           "$ref": "#/definitions/borrowernumber"
86         },
87         "cardnumber": {
88           "description": "library assigned ID number for borrowers"
89         },
90         "surname": {
91           "description": "borrower's last name"
92         },
93         "firstname": {
94           "description": "borrower's first name"
95         }
96       }
97     },
98     "borrowernumber": {
99       "description": "Borrower internal identifier"
100     },
101     "error": {
102       "type": "object",
103       "properties": {
104         "error": {
105           "description": "Error message",
106           "type": "string"
107         }
108       }
109     }
110   },
111   "parameters": {
112     "borrowernumberPathParam": {
113       "name": "borrowernumber",
114       "in": "path",
115       "description": "Internal borrower identifier",
116       "required": true,
117       "type": "integer"
118     }
119   }
120 }