File: load-http.t

package info (click to toggle)
libjson-validator-perl 4.14%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 828 kB
  • sloc: perl: 2,816; makefile: 14
file content (18 lines) | stat: -rw-r--r-- 574 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use Mojo::Base -strict;
use JSON::Validator;
use Test::More;

plan skip_all => 'TEST_ONLINE=1' unless $ENV{TEST_ONLINE};

my $jv = JSON::Validator->new;

$jv->schema('http://swagger.io/v2/schema.json');

isa_ok $jv->schema, 'JSON::Validator::Schema';
like $jv->schema->get('/title'), qr{swagger}i, 'got swagger spec';
ok $jv->schema->get('/patternProperties/^x-/description'), 'resolved vendorExtension $ref';

is_deeply [sort keys %{$jv->store->schemas}],
  ['http://json-schema.org/draft-04/schema', 'http://swagger.io/v2/schema.json'], 'schemas in store';

done_testing;