Bug 36546: (follow-up) Add fallback to unbundled spec

Some developers are running without ktd still and as such may not want
to install the node modules required to bundle the specification.

This patch adds a fallback to the unbundled yaml files when the
bundle.json file isn't found.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Martin Renvoize 2024-05-01 09:16:21 +01:00 committed by Katrin Fischer
parent 24abc7c997
commit f862f78588
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 3 additions and 0 deletions

View File

@ -76,6 +76,9 @@ sub startup {
}
my $spec_file = $self->home->rel_file("api/v1/swagger/swagger_bundle.json");
if (!-f $spec_file) {
$spec_file = $self->home->rel_file("api/v1/swagger/swagger.yaml");
}
push @{$self->routes->namespaces}, 'Koha::Plugin';