Bug 30194: (follow-up) Simply OpenAPI Specification
[koha.git] / api / v1 / swagger / paths / article_requests.yaml
1 ---
2 "/article_requests/{article_request_id}":
3   delete:
4     x-mojo-to: ArticleRequests#cancel
5     operationId: cancelArticleRequest
6     tags:
7       - article_requests
8     summary: Cancel article requests
9     parameters:
10       - name: article_request_id
11         in: path
12         description: Article request identifier
13         required: true
14         type: integer
15       - name: cancellation_reason
16         in: query
17         description: Article request cancellation reason
18         required: false
19         type: string
20       - name: notes
21         in: query
22         description: Article request custom cancellation reason
23         required: false
24         type: string
25     produces:
26       - application/json
27     responses:
28       "204":
29         description: Article request canceled
30       "400":
31         description: Bad request
32         schema:
33           $ref: "../swagger.yaml#/definitions/error"
34       "401":
35         description: Authentication required
36         schema:
37           $ref: "../swagger.yaml#/definitions/error"
38       "403":
39         description: Access forbidden
40         schema:
41           $ref: "../swagger.yaml#/definitions/error"
42       "404":
43         description: Patron not found
44         schema:
45           $ref: "../swagger.yaml#/definitions/error"
46       "500":
47         description: |
48           Internal server error. Possible `error_code` attribute values:
49
50           * `internal_server_error`
51         schema:
52           $ref: "../swagger.yaml#/definitions/error"
53       "503":
54         description: Under maintenance
55         schema:
56           $ref: "../swagger.yaml#/definitions/error"
57     x-koha-authorization:
58       permissions:
59         circulate: circulate_remaining_permissions
60 "/public/patrons/{patron_id}/article_requests/{article_request_id}":
61   delete:
62     x-mojo-to: ArticleRequests#patron_cancel
63     operationId: publicCancelPatronArticleRequest
64     tags:
65       - article_requests
66     summary: Cancel patron's article requests
67     parameters:
68       - $ref: "../swagger.yaml#/parameters/patron_id_pp"
69       - name: article_request_id
70         in: path
71         description: Article request identifier
72         required: true
73         type: integer
74       - name: cancellation_reason
75         in: query
76         description: Article request cancellation reason
77         required: false
78         type: string
79       - name: notes
80         in: query
81         description: Article request custom cancellation reason
82         required: false
83         type: string
84     produces:
85       - application/json
86     responses:
87       "204":
88         description: Patron's article request canceled
89       "400":
90         description: Bad request
91         schema:
92           $ref: "../swagger.yaml#/definitions/error"
93       "401":
94         description: Authentication required
95         schema:
96           $ref: "../swagger.yaml#/definitions/error"
97       "403":
98         description: Access forbidden
99         schema:
100           $ref: "../swagger.yaml#/definitions/error"
101       "404":
102         description: Patron not found
103         schema:
104           $ref: "../swagger.yaml#/definitions/error"
105       "500":
106         description: |
107           Internal server error. Possible `error_code` attribute values:
108
109           * `internal_server_error`
110         schema:
111           $ref: "../swagger.yaml#/definitions/error"
112       "503":
113         description: Under maintenance
114         schema:
115           $ref: "../swagger.yaml#/definitions/error"
116     x-koha-authorization:
117       allow-owner: true