From 50a2efdcc1e39c2e2994da637e54150d00b4e419 Mon Sep 17 00:00:00 2001 From: Lari Taskula Date: Fri, 28 Apr 2017 12:33:33 +0000 Subject: [PATCH] Bug 18508: Fix t/db_dependent/api/v1/swagger/definitions.t (follow-up of 18137) Signed-off-by: Mark Tompsett Signed-off-by: Tomas Cohen Arazi Signed-off-by: Jonathan Druart --- t/db_dependent/api/v1/swagger/definitions.t | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/t/db_dependent/api/v1/swagger/definitions.t b/t/db_dependent/api/v1/swagger/definitions.t index b1fb1847d4..de0647d318 100644 --- a/t/db_dependent/api/v1/swagger/definitions.t +++ b/t/db_dependent/api/v1/swagger/definitions.t @@ -23,14 +23,19 @@ use Test::More tests => 1; use Test::Mojo; use Module::Load::Conditional; -use Swagger2; +use JSON::Validator::OpenAPI; use C4::Context; use Koha::Database; my $swaggerPath = C4::Context->config('intranetdir') . "/api/v1/swagger"; -my $swagger = Swagger2->new( $swaggerPath . "/swagger.json" )->expand; -my $api_spec = $swagger->api_spec->data; +my $swagger = JSON::Validator::OpenAPI->new->load_and_validate_schema( + $swaggerPath . "/swagger.json", + { + allow_invalid_ref => 1 + } +); +my $api_spec = $swagger->schema->data; my $schema = Koha::Database->new->schema; # The basic idea of this test: -- 2.11.0