Browse Source

Bug 25279: Add general query parameters to the /cities route

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
20.05.x
Tomas Cohen Arazi 2 years ago
committed by Martin Renvoize
parent
commit
a07c5c153a
Signed by: martin.renvoize GPG Key ID: 422B469130441A0F
  1. 157
      api/v1/swagger/paths/cities.json

157
api/v1/swagger/paths/cities.json

@ -3,35 +3,63 @@
"get": {
"x-mojo-to": "Cities#list",
"operationId": "listCities",
"tags": ["cities"],
"tags": [
"cities"
],
"produces": [
"application/json"
],
"parameters": [{
"name": "name",
"in": "query",
"description": "Case insensative search on city name",
"required": false,
"type": "string"
}, {
"name": "state",
"in": "query",
"description": "Case insensative search on city state",
"required": false,
"type": "string"
}, {
"name": "country",
"in": "query",
"description": "Case insensative search on city country",
"required": false,
"type": "string"
}, {
"name": "postal_code",
"in": "query",
"description": "Case Insensative search on city postal code",
"required": false,
"type": "string"
}],
"parameters": [
{
"name": "name",
"in": "query",
"description": "Case insensative search on city name",
"required": false,
"type": "string"
},
{
"name": "state",
"in": "query",
"description": "Case insensative search on city state",
"required": false,
"type": "string"
},
{
"name": "country",
"in": "query",
"description": "Case insensative search on city country",
"required": false,
"type": "string"
},
{
"name": "postal_code",
"in": "query",
"description": "Case Insensative search on city postal code",
"required": false,
"type": "string"
},
{
"$ref": "../parameters.json#/match"
},
{
"$ref": "../parameters.json#/order_by"
},
{
"$ref": "../parameters.json#/page"
},
{
"$ref": "../parameters.json#/per_page"
},
{
"$ref": "../parameters.json#/q_param"
},
{
"$ref": "../parameters.json#/q_body"
},
{
"$ref": "../parameters.json#/q_header"
}
],
"responses": {
"200": {
"description": "A list of cities",
@ -63,23 +91,27 @@
},
"x-koha-authorization": {
"permissions": {
"catalogue": "1"
"catalogue": "1"
}
}
},
"post": {
"x-mojo-to": "Cities#add",
"operationId": "addCity",
"tags": ["cities"],
"parameters": [{
"name": "body",
"in": "body",
"description": "A JSON object containing informations about the new hold",
"required": true,
"schema": {
"$ref": "../definitions.json#/city"
"tags": [
"cities"
],
"parameters": [
{
"name": "body",
"in": "body",
"description": "A JSON object containing informations about the new hold",
"required": true,
"schema": {
"$ref": "../definitions.json#/city"
}
}
}],
],
"produces": [
"application/json"
],
@ -126,10 +158,14 @@
"get": {
"x-mojo-to": "Cities#get",
"operationId": "getCity",
"tags": ["cities"],
"parameters": [{
"$ref": "../parameters.json#/city_id_pp"
}],
"tags": [
"cities"
],
"parameters": [
{
"$ref": "../parameters.json#/city_id_pp"
}
],
"produces": [
"application/json"
],
@ -161,25 +197,30 @@
},
"x-koha-authorization": {
"permissions": {
"catalogue": "1"
"catalogue": "1"
}
}
},
"put": {
"x-mojo-to": "Cities#update",
"operationId": "updateCity",
"tags": ["cities"],
"parameters": [{
"$ref": "../parameters.json#/city_id_pp"
}, {
"name": "body",
"in": "body",
"description": "A city object",
"required": true,
"schema": {
"$ref": "../definitions.json#/city"
"tags": [
"cities"
],
"parameters": [
{
"$ref": "../parameters.json#/city_id_pp"
},
{
"name": "body",
"in": "body",
"description": "A city object",
"required": true,
"schema": {
"$ref": "../definitions.json#/city"
}
}
}],
],
"produces": [
"application/json"
],
@ -230,10 +271,14 @@
"delete": {
"x-mojo-to": "Cities#delete",
"operationId": "deleteCity",
"tags": ["cities"],
"parameters": [{
"$ref": "../parameters.json#/city_id_pp"
}],
"tags": [
"cities"
],
"parameters": [
{
"$ref": "../parameters.json#/city_id_pp"
}
],
"produces": [
"application/json"
],

Loading…
Cancel
Save