Bug 42581: Exclude plugins' routes from xt/api.t

If some plugins are installed and inject REST API routes, xt/api.t may fail.

Test plan:
You can install the Jump plugin (https://gitlab.com/joubu/koha-plugin-jump) and run xt/api.t
It will fail:
```
get /contrib/jump/parse -> uses tag 'parse' not present in top level list
get /contrib/jump/search -> uses tag 'search' not present in top level list
get /contrib/jump/search -> uses tag 'objects' not present in top level list
get /contrib/jump/static/static_files/commandPalette.js -> uses tag 'Jump' not present in top level list
get /contrib/jump/static/static_files/jump.css -> uses tag 'Jump' not present in top level list
[...]
```

Apply this patch and run `prove xt/api.t` again
=> It should pass

Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2026-05-12 09:46:54 +02:00 committed by Lucas Gass
parent 4da822b6a1
commit e109e09ae4
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 1 additions and 0 deletions

View File

@ -33,6 +33,7 @@ my $t = Test::Mojo->new('Koha::REST::V1');
my $spec = $t->get_ok( '/api/v1/', 'Correctly fetched the spec' )->tx->res->json;
my $paths = $spec->{paths};
delete @{$paths}{ grep { m{^/contrib/} } keys %$paths }; # Skip routes injected by plugins
my @missing_additionalProperties = ();