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

(-)a/Koha/REST/V1/Illbackends.pm (-3 / +10 lines)
Lines 40-54 sub list { Link Here
40
40
41
    my $config   = Koha::Illrequest::Config->new;
41
    my $config   = Koha::Illrequest::Config->new;
42
    my $backends = $config->available_backends;
42
    my $backends = $config->available_backends;
43
    my $backend_module = Koha::Illbackend->new;
43
44
44
    my @data;
45
    my @data;
45
    foreach my $b (@$backends) {
46
    foreach my $b (@$backends) {
46
        my $backend = Koha::Illrequest->new->load_backend($b);
47
        my $backend = Koha::Illrequest->new->load_backend($b);
47
        push @data,
48
48
          {
49
        my $embed = $backend_module->embed(
50
            $b,
51
            $c->req->headers->header('x-koha-embed')
52
        );
53
54
        my $return = {
49
            ill_backend_id => $b,
55
            ill_backend_id => $b,
50
            capabilities   => $backend->capabilities,
56
            capabilities   => $backend->capabilities,
51
          };
57
        };
58
        push @data, $embed ? { %$return, %$embed } : $return;
52
    }
59
    }
53
    return $c->render( status => 200, openapi => \@data );
60
    return $c->render( status => 200, openapi => \@data );
54
}
61
}
(-)a/api/v1/swagger/paths/ill_backends.yaml (-2 / +11 lines)
Lines 6-12 Link Here
6
    tags:
6
    tags:
7
      - ill_backends
7
      - ill_backends
8
    summary: List ILL backends
8
    summary: List ILL backends
9
    parameters: []
9
    parameters:
10
      - name: x-koha-embed
11
        in: header
12
        required: false
13
        description: Embed list sent as a request header
14
        type: array
15
        items:
16
          type: string
17
          enum:
18
            - statuses+strings
19
        collectionFormat: csv
10
    produces:
20
    produces:
11
      - application/json
21
      - application/json
12
    responses:
22
    responses:
13
- 

Return to bug 34431