From 423f33b8536ef5b8ebdbe8a13237c2b7148d070f 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 --- 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.14.0