View | Details | Raw Unified | Return to bug 17428
Collapse All | Expand All

(-)a/api/v1/swagger/definitions.json (+3 lines)
Lines 1-4 Link Here
1
{
1
{
2
  "city": {
3
    "$ref": "definitions/city.json"
4
  },
2
  "patron": {
5
  "patron": {
3
    "$ref": "definitions/patron.json"
6
    "$ref": "definitions/patron.json"
4
  },
7
  },
(-)a/api/v1/swagger/definitions/city.json (+24 lines)
Line 0 Link Here
1
{
2
  "type": "object",
3
  "properties": {
4
      "cityid": {
5
        "$ref": "../x-primitives.json#/cityid"
6
      },
7
      "city_name": {
8
        "description": "city name",
9
        "type": "string"
10
      },
11
      "city_state": {
12
        "description": "city state",
13
        "type": ["string", "null"]
14
      },
15
      "city_zipcode": {
16
        "description": "city zipcode",
17
        "type": ["string", "null"]
18
      },
19
      "city_country": {
20
        "description": "city country",
21
        "type": ["string", "null"]
22
      }
23
  }
24
}
(-)a/api/v1/swagger/parameters.json (+3 lines)
Lines 5-10 Link Here
5
  "borrowernumberQueryParam": {
5
  "borrowernumberQueryParam": {
6
    "$ref": "parameters/patron.json#/borrowernumberQueryParam"
6
    "$ref": "parameters/patron.json#/borrowernumberQueryParam"
7
  },
7
  },
8
  "cityidPathParam": {
9
    "$ref": "parameters/city.json#/cityidPathParam"
10
  },
8
  "holdIdPathParam": {
11
  "holdIdPathParam": {
9
    "$ref": "parameters/hold.json#/holdIdPathParam"
12
    "$ref": "parameters/hold.json#/holdIdPathParam"
10
  }
13
  }
(-)a/api/v1/swagger/parameters/city.json (+9 lines)
Line 0 Link Here
1
{
2
    "cityidPathParam": {
3
      "name": "cityid",
4
      "in": "path",
5
      "description": "City id",
6
      "required": true,
7
      "type": "integer"
8
    }
9
}
(-)a/api/v1/swagger/paths.json (+6 lines)
Lines 1-4 Link Here
1
{
1
{
2
  "/cities": {
3
    "$ref": "paths/cities.json#/~1cities"
4
  },
5
  "/cities/{cityid}": {
6
    "$ref": "paths/cities.json#/~1cities~1{cityid}"
7
  },
2
  "/holds": {
8
  "/holds": {
3
    "$ref": "paths/holds.json#/~1holds"
9
    "$ref": "paths/holds.json#/~1holds"
4
  },
10
  },
(-)a/api/v1/swagger/paths/cities.json (+217 lines)
Line 0 Link Here
1
{
2
  "/cities": {
3
    "get": {
4
      "x-mojo-controller": "Koha::REST::V1::Cities",
5
      "operationId": "list",
6
      "tags": ["cities"],
7
      "produces": [
8
        "application/json"
9
      ],
10
      "responses": {
11
        "200": {
12
          "description": "A list of cities",
13
          "schema": {
14
            "type": "array",
15
            "items": {
16
              "$ref": "../definitions.json#/city"
17
            }
18
          }
19
        },
20
        "403": {
21
          "description": "Access forbidden",
22
          "schema": {
23
            "$ref": "../definitions.json#/error"
24
          }
25
        },
26
        "500": {
27
            "description": "Internal error",
28
            "schema": {
29
                "$ref": "../definitions.json#/error"
30
            }
31
        }
32
      }
33
    },
34
    "post": {
35
      "x-mojo-controller": "Koha::REST::V1::Cities",
36
      "operationId": "add",
37
      "tags": ["cities"],
38
      "parameters": [{
39
          "name": "body",
40
          "in": "body",
41
          "description": "A JSON object containing informations about the new hold",
42
          "required": true,
43
          "schema": {
44
            "$ref": "../definitions.json#/city"
45
          }
46
        }
47
      ],
48
      "produces": [
49
        "application/json"
50
      ],
51
      "responses": {
52
        "200": {
53
          "description": "City added",
54
          "schema": {
55
            "$ref": "../definitions.json#/city"
56
          }
57
        },
58
        "403": {
59
          "description": "Access forbidden",
60
          "schema": {
61
            "$ref": "../definitions.json#/error"
62
          }
63
        },
64
        "500": {
65
            "description": "Internal error",
66
            "schema": {
67
                "$ref": "../definitions.json#/error"
68
            }
69
        }
70
      },
71
      "x-koha-authorization": {
72
        "permissions": {
73
          "parameters": "parameters_remaining_permissions"
74
        }
75
      }
76
    }
77
  },
78
  "/cities/{cityid}": {
79
    "get": {
80
      "x-mojo-controller": "Koha::REST::V1::Cities",
81
      "operationId": "get",
82
      "tags": ["cities"],
83
      "parameters": [
84
        {
85
          "$ref": "../parameters.json#/cityidPathParam"
86
        }
87
      ],
88
      "produces": [
89
        "application/json"
90
      ],
91
      "responses": {
92
        "200": {
93
          "description": "A city",
94
          "schema": {
95
            "$ref": "../definitions.json#/city"
96
          }
97
        },
98
        "403": {
99
          "description": "Access forbidden",
100
          "schema": {
101
            "$ref": "../definitions.json#/error"
102
          }
103
        },
104
        "404": {
105
          "description": "City not found",
106
          "schema": {
107
            "$ref": "../definitions.json#/error"
108
          }
109
        }
110
        ,
111
        "500": {
112
            "description": "Internal error",
113
            "schema": {
114
                "$ref": "../definitions.json#/error"
115
            }
116
        }
117
      }
118
    },
119
    "put": {
120
      "x-mojo-controller": "Koha::REST::V1::Cities",
121
      "operationId": "update",
122
      "tags": ["cities"],
123
      "parameters": [
124
        {
125
          "$ref": "../parameters.json#/cityidPathParam"
126
        },
127
        {
128
          "name": "body",
129
          "in": "body",
130
          "description": "A JSON object containing informations about the new hold",
131
          "required": true,
132
          "schema": {
133
            "$ref": "../definitions.json#/city"
134
          }
135
        }
136
      ],
137
      "produces": [
138
        "application/json"
139
      ],
140
      "responses": {
141
        "200": {
142
          "description": "A city",
143
          "schema": {
144
            "$ref": "../definitions.json#/city"
145
          }
146
        },
147
        "403": {
148
          "description": "Access forbidden",
149
          "schema": {
150
            "$ref": "../definitions.json#/error"
151
          }
152
        },
153
        "404": {
154
          "description": "City not found",
155
          "schema": {
156
            "$ref": "../definitions.json#/error"
157
          }
158
        },
159
        "500": {
160
            "description": "Internal error",
161
            "schema": {
162
                "$ref": "../definitions.json#/error"
163
            }
164
        }
165
      },
166
      "x-koha-authorization": {
167
        "permissions": {
168
          "parameters": "parameters_remaining_permissions"
169
        }
170
      }
171
    },
172
    "delete": {
173
      "x-mojo-controller": "Koha::REST::V1::Cities",
174
      "operationId": "delete",
175
      "tags": ["cities"],
176
      "parameters": [
177
        {
178
          "$ref": "../parameters.json#/cityidPathParam"
179
        }
180
      ],
181
      "produces": [
182
        "application/json"
183
      ],
184
      "responses": {
185
        "200": {
186
          "description": "City deleted",
187
          "schema": {
188
            "type": "string"
189
          }
190
        },
191
        "403": {
192
          "description": "Access forbidden",
193
          "schema": {
194
            "$ref": "../definitions.json#/error"
195
          }
196
        },
197
        "404": {
198
          "description": "City not found",
199
          "schema": {
200
            "$ref": "../definitions.json#/error"
201
          }
202
        },
203
        "500": {
204
            "description": "Internal error",
205
            "schema": {
206
                "$ref": "../definitions.json#/error"
207
            }
208
        }
209
      },
210
      "x-koha-authorization": {
211
        "permissions": {
212
          "parameters": "parameters_remaining_permissions"
213
        }
214
      }
215
    }
216
  }
217
}
(-)a/api/v1/swagger/x-primitives.json (-1 / +4 lines)
Lines 15-20 Link Here
15
    "type": ["string", "null"],
15
    "type": ["string", "null"],
16
    "description": "library assigned user identifier"
16
    "description": "library assigned user identifier"
17
  },
17
  },
18
  "cityid": {
19
    "type": "string",
20
    "description": "internally assigned city identifier"
21
  },
18
  "email": {
22
  "email": {
19
    "type": ["string", "null"],
23
    "type": ["string", "null"],
20
    "description": "primary email address for patron's primary address"
24
    "description": "primary email address for patron's primary address"
21
- 

Return to bug 17428