Koha/api/v1/swagger/paths/patrons.json
Lari Taskula 915963ba7f Bug 18137: Make /patrons Mojolicious::Plugin::OpenAPI compatible
Also:
- adding some missing and new response definitions into Swagger spec.
- fixing failing test due to Bug 17932's change of boolean values

To test:
1. prove t/db_dependent/api/v1/patrons.t

Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-09-21 11:27:05 -03:00

111 lines
2.6 KiB
JSON

{
"/patrons": {
"get": {
"x-mojo-to": "Patron#list",
"operationId": "listPatrons",
"tags": ["patrons"],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "A list of patrons",
"schema": {
"type": "array",
"items": {
"$ref": "../definitions.json#/patron"
}
}
},
"401": {
"description": "Authentication required",
"schema": {
"$ref": "../definitions.json#/error"
}
},
"403": {
"description": "Access forbidden",
"schema": {
"$ref": "../definitions.json#/error"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "../definitions.json#/error"
}
},
"503": {
"description": "Under maintenance",
"schema": {
"$ref": "../definitions.json#/error"
}
}
},
"x-koha-authorization": {
"permissions": {
"borrowers": "1"
}
}
}
},
"/patrons/{borrowernumber}": {
"get": {
"x-mojo-to": "Patron#get",
"operationId": "getPatron",
"tags": ["patrons"],
"parameters": [{
"$ref": "../parameters.json#/borrowernumberPathParam"
}
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "A patron",
"schema": {
"$ref": "../definitions.json#/patron"
}
},
"401": {
"description": "Authentication required",
"schema": {
"$ref": "../definitions.json#/error"
}
},
"403": {
"description": "Access forbidden",
"schema": {
"$ref": "../definitions.json#/error"
}
},
"404": {
"description": "Patron not found",
"schema": {
"$ref": "../definitions.json#/error"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "../definitions.json#/error"
}
},
"503": {
"description": "Under maintenance",
"schema": {
"$ref": "../definitions.json#/error"
}
}
},
"x-koha-authorization": {
"allow-owner": true,
"allow-guarantor": true,
"permissions": {
"borrowers": "1"
}
}
}
}
}