Bug 16497: Add /api/v1/libraries
[koha.git] / api / v1 / swagger / paths / public_patrons.json
1 {
2   "/public/patrons/{patron_id}/password": {
3     "post": {
4       "x-mojo-to": "Patrons::Password#set_public",
5       "operationId": "setPatronPasswordPublic",
6       "tags": [
7         "patron"
8       ],
9       "parameters": [
10         {
11           "$ref": "../parameters.json#/patron_id_pp"
12         },
13         {
14           "name": "body",
15           "in": "body",
16           "description": "A JSON object containing password information",
17           "schema": {
18             "type": "object",
19             "properties": {
20               "password": {
21                 "description": "New password (plain text)",
22                 "type": "string"
23               },
24               "password_repeated": {
25                 "description": "Repeated new password (plain text)",
26                 "type": "string"
27               },
28               "old_password": {
29                 "description": "Patron's original password",
30                 "type": "string"
31               }
32             },
33             "required": ["password", "password_repeated", "old_password"]
34           }
35         }
36       ],
37       "produces": [
38         "application/json"
39       ],
40       "responses": {
41         "200": {
42           "description": "Password changed"
43         },
44         "400": {
45           "description": "Bad request",
46           "schema": {
47             "$ref": "../definitions.json#/error"
48           }
49         },
50         "401": {
51           "description": "Authentication required",
52           "schema": {
53             "$ref": "../definitions.json#/error"
54           }
55         },
56         "403": {
57           "description": "Access forbidden",
58           "schema": {
59             "$ref": "../definitions.json#/error"
60           }
61         },
62         "404": {
63           "description": "Patron not found",
64           "schema": {
65             "$ref": "../definitions.json#/error"
66           }
67         },
68         "500": {
69           "description": "Internal server error",
70           "schema": {
71             "$ref": "../definitions.json#/error"
72           }
73         },
74         "503": {
75           "description": "Under maintenance",
76           "schema": {
77             "$ref": "../definitions.json#/error"
78           }
79         }
80       },
81       "x-koha-authorization": {
82         "allow-owner": true
83       }
84     }
85   }
86 }