Bug 7317: (QA followup) Make query parameters consistent with other endpoints
[koha.git] / api / v1 / swagger / paths / patrons.json
1 {
2   "/patrons": {
3     "get": {
4       "x-mojo-to": "Patron#list",
5       "operationId": "listPatrons",
6       "tags": ["patrons"],
7       "produces": [
8           "application/json"
9       ],
10       "responses": {
11         "200": {
12           "description": "A list of patrons",
13           "schema": {
14             "type": "array",
15             "items": {
16               "$ref": "../definitions.json#/patron"
17             }
18           }
19         },
20         "401": {
21           "description": "Authentication required",
22           "schema": {
23             "$ref": "../definitions.json#/error"
24           }
25         },
26         "403": {
27           "description": "Access forbidden",
28           "schema": {
29             "$ref": "../definitions.json#/error"
30           }
31         },
32         "500": {
33           "description": "Internal server error",
34           "schema": {
35             "$ref": "../definitions.json#/error"
36           }
37         },
38         "503": {
39           "description": "Under maintenance",
40           "schema": {
41             "$ref": "../definitions.json#/error"
42           }
43         }
44       },
45       "x-koha-authorization": {
46         "permissions": {
47           "borrowers": "1"
48         }
49       }
50     }
51   },
52   "/patrons/{borrowernumber}": {
53     "get": {
54       "x-mojo-to": "Patron#get",
55       "operationId": "getPatron",
56       "tags": ["patrons"],
57       "parameters": [{
58           "$ref": "../parameters.json#/borrowernumberPathParam"
59         }
60       ],
61       "produces": [
62           "application/json"
63       ],
64       "responses": {
65         "200": {
66           "description": "A patron",
67           "schema": {
68             "$ref": "../definitions.json#/patron"
69           }
70         },
71         "401": {
72           "description": "Authentication required",
73           "schema": {
74             "$ref": "../definitions.json#/error"
75           }
76         },
77         "403": {
78           "description": "Access forbidden",
79           "schema": {
80             "$ref": "../definitions.json#/error"
81           }
82         },
83         "404": {
84           "description": "Patron not found",
85           "schema": {
86             "$ref": "../definitions.json#/error"
87           }
88         },
89         "500": {
90           "description": "Internal server error",
91           "schema": {
92             "$ref": "../definitions.json#/error"
93           }
94         },
95         "503": {
96           "description": "Under maintenance",
97           "schema": {
98             "$ref": "../definitions.json#/error"
99           }
100         }
101       },
102       "x-koha-authorization": {
103         "allow-owner": true,
104         "allow-guarantor": true,
105         "permissions": {
106           "borrowers": "1"
107         }
108       }
109     }
110   }
111 }