Bug 15126: Refactor spec file
[koha.git] / api / v1 / swagger.json
blob8f32781df4d38f5375d34666f2a16298739a1c90
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     "/patrons": {
18       "get": {
19         "x-mojo-controller": "Koha::REST::V1::Patrons",
20         "operationId": "listPatrons",
21         "tags": ["patrons"],
22         "produces": [
23           "application/json"
24         ],
25         "responses": {
26           "200": {
27             "description": "A list of patrons",
28             "schema": {
29               "type": "array",
30               "items": {
31                 "$ref": "#/definitions/patron"
32               }
33             }
34           },
35           "403": {
36             "description": "Access forbidden",
37             "schema": {
38               "$ref": "#/definitions/error"
39             }
40           }
41         }
42       }
43     },
44     "/patrons/{borrowernumber}": {
45       "get": {
46         "x-mojo-controller": "Koha::REST::V1::Patrons",
47         "operationId": "getPatron",
48         "tags": ["patrons"],
49         "parameters": [
50           {
51             "$ref": "#/parameters/borrowernumberPathParam"
52           }
53         ],
54         "produces": [
55           "application/json"
56         ],
57         "responses": {
58           "200": {
59             "description": "A patron",
60             "schema": {
61               "$ref": "#/definitions/patron"
62             }
63           },
64           "403": {
65             "description": "Access forbidden",
66             "schema": {
67               "$ref": "#/definitions/error"
68             }
69           },
70           "404": {
71             "description": "Patron not found",
72             "schema": {
73               "$ref": "#/definitions/error"
74             }
75           }
76         }
77       }
78     }
79   },
80   "definitions": {
81     "$ref": "./definitions/index.json"
82   },
83   "parameters": {
84     "borrowernumberPathParam": {
85       "name": "borrowernumber",
86       "in": "path",
87       "description": "Internal patron identifier",
88       "required": true,
89       "type": "integer"
90     }
91   }