return $c->render( status => 200, openapi => \@data );
}
+=head3 get
+
+Get one backend
+
+=cut
+
+sub get {
+ my $c = shift->openapi->valid_input;
+
+ my $backend_id = $c->validation->param('ill_backend_id');
+
+ return try {
+ my $backend = Koha::Illrequest->new->load_backend( $backend_id );
+ return $c->render(
+ status => 200,
+ openapi => {
+ ill_backend_id => $backend_id,
+ capabilities => $backend->capabilities
+ }
+ );
+ } catch {
+ return $c->render(
+ status => 404,
+ openapi => { error => "ILL backend does not exist" }
+ );
+ };
+}
+
1;
"/ill_backends": {
"$ref": "paths/ill_backends.json#/~1ill_backends"
},
+ "/ill_backends/{ill_backend_id}": {
+ "$ref": "paths/ill_backends.json#/~1ill_backends~1{ill_backend_id}"
+ },
"/illrequests": {
"$ref": "paths/illrequests.json#/~1illrequests"
},
}
}
}
+ },
+ "/ill_backends/{ill_backend_id}": {
+ "get": {
+ "x-mojo-to": "Illbackends#get",
+ "operationId": "getIllbackends",
+ "tags": ["illbackends"],
+ "parameters": [
+ {
+ "name": "ill_backend_id",
+ "in": "path",
+ "description": "ILL backend id/name",
+ "required": true,
+ "type": "string"
+ }
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "responses": {
+ "200": {
+ "description": "An ILL backends",
+ "schema": {
+ "$ref": "../definitions.json#/ill_backend"
+ }
+ },
+ "401": {
+ "description": "Authentication required",
+ "schema": {
+ "$ref": "../definitions.json#/error"
+ }
+ },
+ "403": {
+ "description": "Access forbidden",
+ "schema": {
+ "$ref": "../definitions.json#/error"
+ }
+ },
+ "404": {
+ "description": "ILL backends 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"
+ }
+ }
+ }
}
}