67632e1bbc08f10fa6c48e6414e0560e597941ff
[koha.git] / api / v1 / swagger / paths / patrons.json
1 {
2   "/patrons": {
3     "get": {
4       "operationId": "listPatrons",
5       "tags": ["patrons"],
6       "produces": [
7           "application/json"
8       ],
9       "responses": {
10         "200": {
11           "description": "A list of patrons",
12           "schema": {
13             "type": "array",
14             "items": {
15               "$ref": "../definitions.json#/patron"
16             }
17           }
18         },
19         "403": {
20           "description": "Access forbidden",
21           "schema": {
22             "$ref": "../definitions.json#/error"
23           }
24         }
25       },
26       "x-koha-authorization": {
27         "permissions": {
28           "borrowers": "1"
29         }
30       }
31     }
32   },
33   "/patrons/{borrowernumber}": {
34     "get": {
35       "operationId": "getPatron",
36       "tags": ["patrons"],
37       "parameters": [{
38           "$ref": "../parameters.json#/borrowernumberPathParam"
39         }
40       ],
41       "produces": [
42           "application/json"
43       ],
44       "responses": {
45         "200": {
46           "description": "A patron",
47           "schema": {
48             "$ref": "../definitions.json#/patron"
49           }
50         },
51         "403": {
52           "description": "Access forbidden",
53           "schema": {
54             "$ref": "../definitions.json#/error"
55           }
56         },
57         "404": {
58           "description": "Patron not found",
59           "schema": {
60             "$ref": "../definitions.json#/error"
61           }
62         }
63       },
64       "x-koha-authorization": {
65         "allow-owner": true,
66         "allow-guarantor": true,
67         "permissions": {
68           "borrowers": "1"
69         }
70       }
71     }
72   }
73 }