Koha/api/v1/swagger/paths/illrequests.json
Tomas Cohen Arazi c99e814a6f Bug 7317: (followup) Migrate endpoint to OpenAPI
This patch moves the current endpoint implementation from Swagger2 to
the OpenAPI plugin.

It also takes advantage of the overloaded Koha::Illrequest::TO_JSON method
which has now the option to embed what's needed for the REST api.

The path spec is adjusted to fit OpenAPI, and some minor fixes are
applied:
- Missing 'metadata' query param
- 'ill' permissions should be required instead of 'borrowers'
- Full test coverage

To test:
- Apply  this patch
- Run:
  $ kshell
 k$ prove t/db_dependent/api/v1/illrequests.t
=> SUCCESS: Tests pass!
- Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>

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

129 lines
4.3 KiB
JSON

{
"/illrequests": {
"get": {
"x-mojo-to": "Illrequests#list",
"operationId": "listIllrequests",
"tags": ["illrequests"],
"parameters": [{
"name": "embed",
"in": "query",
"description": "Additional objects that should be embedded in the response",
"required": false,
"type": "array",
"collectionFormat": "csv",
"items": {
"type": "string",
"enum": [
"patron",
"branch",
"capabilities",
"metadata"
]
}
}, {
"name": "backend",
"in": "query",
"description": "The name of a ILL backend",
"required": false,
"type": "string"
}, {
"name": "orderid",
"in": "query",
"description": "The order ID of a request",
"required": false,
"type": "string"
}, {
"name": "biblio_id",
"in": "query",
"description": "The biblio ID associated with a request",
"required": false,
"type": "integer"
}, {
"name": "borrower_id",
"in": "query",
"description": "The borrower ID associated with a request",
"required": false,
"type": "integer"
}, {
"name": "completed",
"in": "query",
"description": "The date the request was considered completed",
"required": false,
"type": "string"
}, {
"name": "status",
"in": "query",
"description": "A full status string e.g. REQREV",
"required": false,
"type": "string"
}, {
"name": "medium",
"in": "query",
"description": "The medium of the requested item",
"required": false,
"type": "string"
}, {
"name": "updated",
"in": "query",
"description": "The last updated date of the request",
"required": false,
"type": "string"
}, {
"name": "placed",
"in": "query",
"description": "The date the request was placed",
"required": false,
"type": "string"
}, {
"name": "branch_id",
"in": "query",
"description": "The ID of the pickup branch",
"required": false,
"type": "string"
}],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "A list of ILL requests"
},
"401": {
"description": "Authentication required",
"schema": {
"$ref": "../definitions.json#/error"
}
},
"403": {
"description": "Access forbidden",
"schema": {
"$ref": "../definitions.json#/error"
}
},
"404": {
"description": "ILL requests 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": {
"permissions": {
"ill": "1"
}
}
}
}
}