| 1 | package JSON::Validator::Schema::Draft201909; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | 13 | ▶ | use Mojo::Base 'JSON::Validator::Schema'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||||||||||||||||
| 4 | 13 | ▶ | use JSON::Validator::Schema::Draft4; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | 13 | ▶ | use JSON::Validator::Schema::Draft6; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | 13 | ▶ | use JSON::Validator::Schema::Draft7; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 7 | 13 | ▶ | use JSON::Validator::URI qw(uri); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 8 | 13 | ▶ | use JSON::Validator::Util qw(E is_bool is_type); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||
| 10 | 13 | has moniker => 'draft2019'; | |||||||||||||||||||||||||||||||||||||||||
| 11 | 13 | has specification => 'https://json-schema.org/draft/2019-09/schema'; | |||||||||||||||||||||||||||||||||||||||||
| 12 | 16 | ▶ | has _ref_keys => sub { [qw($ref $recursiveRef)] }; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||
| 14 | 2 | ▶ | sub _build_formats { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_build_formats: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 15 | 2 | my $formats = shift->JSON::Validator::Schema::Draft7::_build_formats; | |||||||||||||||||||||||||||||||||||||||||
| 16 | 2 | $formats->{duration} = JSON::Validator::Formats->can('check_duration'); | |||||||||||||||||||||||||||||||||||||||||
| 17 | 2 | $formats->{uuid} = JSON::Validator::Formats->can('check_uuid'); | |||||||||||||||||||||||||||||||||||||||||
| 18 | 2 | return $formats; | |||||||||||||||||||||||||||||||||||||||||
| 19 | } | ||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||
| 21 | 0 | ▶ | sub _bundle_ref_path_expand { local $_ = $_[1]; s!^\$defs/!!; return '$defs', $_; } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_bundle_ref_path_expand: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||
| 22 | 59785 | ▶ | sub _extract_ref_from_schema { $_[1]->{'$recursiveRef'} // $_[1]->{'$ref'} } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_extract_ref_from_schema: called CC=2 SCAR=7.2
Condition66%2/3
$_[1]{"\$recursiveRef"} // $_[1]{"\$ref"}
MC/DC0%0/2
$_[1]{"\$recursiveRef"} // $_[1]{"\$ref"}
$_[1]{"\$recursiveRef"}
$_[1]{"\$ref"}
Truth table66%2/3
A // B
A= $_[1]{"\$recursiveRef"}B= $_[1]{"\$ref"}
| |||||||||||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||||||||||
| 24 | 207880 | ▶ | sub _resolve_object { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_resolve_object: called CC=9 SCAR=22.0
| |||||||||||||||||||||||||||||||||||||||||||
| 25 | 207880 | my ($self, $state, $schema, $refs, $found) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||||
| 27 | 207880 | ▶ | if ($schema->{'$id'} and !ref $schema->{'$id'}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$schema->{"\$id"} and not ref $schema->{"\$id"}
MC/DC100%2/2
$schema->{"\$id"} and not ref $schema->{"\$id"}
$schema->{"\$id"}
not ref $schema->{"\$id"}
Truth table100%3/3
A and not(B)
A= $schema->{"\$id"}B= not ref $schema->{"\$id"}
| |||||||||||||||||||||||||||||||||||||||||||
| 28 | 512 | my $id = uri $schema->{'$id'}, $state->{base_url}; | |||||||||||||||||||||||||||||||||||||||||
| 29 | 512 | $self->store->add($id => $schema); | |||||||||||||||||||||||||||||||||||||||||
| 30 | 512 | $state = {%$state}; # make sure we don't mutate $state ref | |||||||||||||||||||||||||||||||||||||||||
| 31 | 512 | $state->{base_url} = $id->clone->fragment(undef); | |||||||||||||||||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||||||||||||||||
| 33 | 207880 | ▶ | if ($schema->{'$anchor'} && !ref $schema->{'$anchor'}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$schema->{"\$anchor"} and not ref $schema->{"\$anchor"}
MC/DC100%2/2
$schema->{"\$anchor"} and not ref $schema->{"\$anchor"}
$schema->{"\$anchor"}
not ref $schema->{"\$anchor"}
Truth table100%3/3
A and not(B)
A= $schema->{"\$anchor"}B= not ref $schema->{"\$anchor"}
| |||||||||||||||||||||||||||||||||||||||||||
| 34 | 1 | my $id = uri(uri()->new->fragment($schema->{'$anchor'}), $state->{base_url}); | |||||||||||||||||||||||||||||||||||||||||
| 35 | 1 | $self->store->add($id => $schema); | |||||||||||||||||||||||||||||||||||||||||
| 36 | 1 | $state = {%$state, base_url => $id->fragment(undef)->to_string}; | |||||||||||||||||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||||||||
| 39 | 207880 | ▶ | if ($found->{'$recursiveRef'} = $schema->{'$recursiveRef'} && !ref $schema->{'$recursiveRef'}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$schema->{'$recursiveRef'} && !ref($schema->{'$recursiveRef'})
MC/DC100%2/2
$schema->{'$recursiveRef'} && !ref($schema->{'$recursiveRef'})
$schema->{'$recursiveRef'}
!ref($schema->{'$recursiveRef'})
Truth table100%3/3
A && not(B)
A= $schema->{'$recursiveRef'}B= !ref($schema->{'$recursiveRef'})
| |||||||||||||||||||||||||||||||||||||||||||
| 40 | 22 | push @$refs, [$schema, $state]; | |||||||||||||||||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||||||||||||||||
| 42 | 207880 | ▶ | if ($found->{'$ref'} = $schema->{'$ref'} && !ref $schema->{'$ref'}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$schema->{'$ref'} && !ref($schema->{'$ref'})
MC/DC100%2/2
$schema->{'$ref'} && !ref($schema->{'$ref'})
$schema->{'$ref'}
!ref($schema->{'$ref'})
Truth table100%3/3
A && not(B)
A= $schema->{'$ref'}B= !ref($schema->{'$ref'})
| |||||||||||||||||||||||||||||||||||||||||||
| 43 | 59763 | push @$refs, [$schema, $state]; | |||||||||||||||||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||||||||||
| 46 | 207880 | return $state; | |||||||||||||||||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||||||||||
| 49 | 47709 | ▶ | sub _state { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_state: called CC=9 SCAR=22.5
| |||||||||||||||||||||||||||||||||||||||||||
| 50 | 47709 | my ($self, $curr, %override) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 51 | 47709 | my $schema = $override{schema}; | |||||||||||||||||||||||||||||||||||||||||
| 52 | 47709 | my (%alongside, %seen); | |||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||
| 54 | 47709 | ▶ | while (ref $schema eq 'HASH') { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 55 | 55169 | ▶ | last unless my $ref = $schema->{'$ref'} || $schema->{'$recursiveRef'}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$schema->{'$ref'} || $schema->{'$recursiveRef'}
MC/DC100%2/2
$schema->{'$ref'} || $schema->{'$recursiveRef'}
$schema->{'$ref'}
$schema->{'$recursiveRef'}
Truth table100%3/3
A || B
A= $schema->{'$ref'}B= $schema->{'$recursiveRef'}
| |||||||||||||||||||||||||||||||||||||||||||
| 56 | 7460 | ▶ | last if ref $ref; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 57 | 7460 | ▶ | last if $seen{$schema}++; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||||||||||
| 59 | 7460 | %alongside = (%alongside, %$schema); | |||||||||||||||||||||||||||||||||||||||||
| 60 | $schema = $self->_refs->{$schema}{schema} | ||||||||||||||||||||||||||||||||||||||||||
| 61 | 7460 | ▶ | // Carp::confess(qq(You have to call resolve() before validate() to lookup "$ref".)); | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$self->_refs->{$schema}{"schema"} // Carp::confess(qq[You have to call resolve() before validate() to lookup "$ref".])
MC/DC0%0/1
$self->_refs->{$schema}{"schema"} // Carp::confess(qq[You have to call resolve() before validate() to lookup "$ref".])
$self->_refs->{$schema}{"schema"}
Truth table50%1/2
A
A= $self->_refs->{$schema}{"schema"}
| |||||||||||||||||||||||||||||||||||||||||||
| 62 | } | ||||||||||||||||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||||||||||||||||
| 64 | 47709 | ▶ | return {%$curr, %override, schema => $schema} unless ref $schema eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||||||||||||||||
| 66 | 47709 | delete $alongside{$_} for qw($anchor $id $recursiveAnchor $recursiveRef $ref); | |||||||||||||||||||||||||||||||||||||||||
| 67 | 47709 | return {%$curr, %override, schema => {%alongside, %$schema}}; | |||||||||||||||||||||||||||||||||||||||||
| 68 | } | ||||||||||||||||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||||||||||||||||
| 70 | 63 | ▶ | sub _validate_type_array_contains { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_validate_type_array_contains: called CC=16 SCAR=28.7
| |||||||||||||||||||||||||||||||||||||||||||
| 71 | 63 | my ($self, $data, $state) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 72 | 63 | my ($path, $schema) = @$state{qw(path schema)}; | |||||||||||||||||||||||||||||||||||||||||
| 73 | 63 | ▶ | return unless exists $schema->{contains}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 74 | 6 | ▶ | return if defined $schema->{minContains} and $schema->{minContains} == 0 and !$schema->{maxContains}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%3/6
defined $schema->{"minContains"} and $schema->{"minContains"} == 0 and not $schema->{"maxContains"}
defined $schema->{"minContains"} and $schema->{"minContains"} == 0
MC/DC0%0/3
defined $schema->{"minContains"} and $schema->{"minContains"} == 0 and not $schema->{"maxContains"}
defined $schema->{"minContains"}
$schema->{"minContains"} == 0
not $schema->{"maxContains"}
Truth table50%2/4
A and B and not(C)
A= defined $schema->{"minContains"}B= $schema->{"minContains"} == 0C= not $schema->{"maxContains"}
| |||||||||||||||||||||||||||||||||||||||||||
| 75 | 6 | ▶ | return if defined $schema->{minContains} and $schema->{minContains} == 0 and !@$data; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%3/6
defined $schema->{"minContains"} and $schema->{"minContains"} == 0 and not @$data
defined $schema->{"minContains"} and $schema->{"minContains"} == 0
MC/DC0%0/3
defined $schema->{"minContains"} and $schema->{"minContains"} == 0 and not @$data
defined $schema->{"minContains"}
$schema->{"minContains"} == 0
not @$data
Truth table50%2/4
A and B and not(C)
A= defined $schema->{"minContains"}B= $schema->{"minContains"} == 0C= not @$data
| |||||||||||||||||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||||||||||||||||
| 77 | 6 | my ($n_valid, @e, @errors) = (0); | |||||||||||||||||||||||||||||||||||||||||
| 78 | 6 | for my $i (0 .. @$data - 1) { | |||||||||||||||||||||||||||||||||||||||||
| 79 | 14 | my @tmp = $self->_validate($data->[$i], $self->_state($state, path => [@$path, $i], schema => $schema->{contains})); | |||||||||||||||||||||||||||||||||||||||||
| 80 | 14 | ▶ | @tmp ? push @e, \@tmp : $n_valid++; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 81 | } | ||||||||||||||||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||||||||||||||||
| 83 | 6 | ▶ | push @errors, map {@$_} @e if @e >= @$data; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 84 | push @errors, E $path, [array => 'maxContains', int @$data, $schema->{maxContains}] | ||||||||||||||||||||||||||||||||||||||||||
| 85 | 6 | ▶ | if exists $schema->{maxContains} and $n_valid > $schema->{maxContains}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
exists $schema->{"maxContains"} and $n_valid > $schema->{"maxContains"}
MC/DC100%2/2
exists $schema->{"maxContains"} and $n_valid > $schema->{"maxContains"}
exists $schema->{"maxContains"}
$n_valid > $schema->{"maxContains"}
Truth table100%3/3
A and B
A= exists $schema->{"maxContains"}B= $n_valid > $schema->{"maxContains"}
| |||||||||||||||||||||||||||||||||||||||||||
| 86 | push @errors, E $path, [array => 'minContains', int @$data, $schema->{minContains}] | ||||||||||||||||||||||||||||||||||||||||||
| 87 | 6 | ▶ | if $schema->{minContains} and $n_valid < $schema->{minContains}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$schema->{"minContains"} and $n_valid < $schema->{"minContains"}
MC/DC100%2/2
$schema->{"minContains"} and $n_valid < $schema->{"minContains"}
$schema->{"minContains"}
$n_valid < $schema->{"minContains"}
Truth table100%3/3
A and B
A= $schema->{"minContains"}B= $n_valid < $schema->{"minContains"}
| |||||||||||||||||||||||||||||||||||||||||||
| 88 | 6 | ▶ | push @errors, E $path, [array => 'contains'] if not @$data; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 89 | 6 | return @errors; | |||||||||||||||||||||||||||||||||||||||||
| 90 | } | ||||||||||||||||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||||||||||||||||
| 92 | 10675 | ▶ | sub _validate_type_object_dependencies { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_validate_type_object_dependencies: called CC=8 SCAR=20.8
| |||||||||||||||||||||||||||||||||||||||||||
| 93 | 10675 | my ($self, $data, $state) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 94 | 10675 | ▶ | my $dependencies = $state->{schema}{dependentSchemas} || {}; | ||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$state->{'schema'}{'dependentSchemas'} || {}
MC/DC100%1/1
$state->{'schema'}{'dependentSchemas'} || {}
$state->{'schema'}{'dependentSchemas'}
Truth table100%2/2
A
A= $state->{'schema'}{'dependentSchemas'}
| |||||||||||||||||||||||||||||||||||||||||||
| 95 | 10675 | my @errors; | |||||||||||||||||||||||||||||||||||||||||
| 96 | |||||||||||||||||||||||||||||||||||||||||||
| 97 | 10675 | for my $k (keys %$dependencies) { | |||||||||||||||||||||||||||||||||||||||||
| 98 | 501 | ▶ | next if not exists $data->{$k}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 99 | 501 | ▶ | if (ref $dependencies->{$k} eq 'ARRAY') { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 100 | push @errors, | ||||||||||||||||||||||||||||||||||||||||||
| 101 | 1 | map { E [@{$state->{path}}, $_], [object => dependencies => $k] } | |||||||||||||||||||||||||||||||||||||||||
| 102 | 1 | grep { !exists $data->{$_} } @{$dependencies->{$k}}; | |||||||||||||||||||||||||||||||||||||||||
| 103 | } | ||||||||||||||||||||||||||||||||||||||||||
| 104 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 105 | 500 | push @errors, $self->_validate($data, $self->_state($state, schema => $dependencies->{$k})); | |||||||||||||||||||||||||||||||||||||||||
| 106 | } | ||||||||||||||||||||||||||||||||||||||||||
| 107 | } | ||||||||||||||||||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||||||||||||||||||
| 109 | 10675 | ▶ | $dependencies = $state->{schema}{dependentRequired} || {}; | ||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$state->{'schema'}{'dependentRequired'} || {}
MC/DC100%1/1
$state->{'schema'}{'dependentRequired'} || {}
$state->{'schema'}{'dependentRequired'}
Truth table100%2/2
A
A= $state->{'schema'}{'dependentRequired'}
| |||||||||||||||||||||||||||||||||||||||||||
| 110 | 10675 | for my $k (keys %$dependencies) { | |||||||||||||||||||||||||||||||||||||||||
| 111 | 1 | ▶ | next if not exists $data->{$k}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 112 | push @errors, | ||||||||||||||||||||||||||||||||||||||||||
| 113 | 1 | map { E [@{$state->{path}}, $_], [object => dependencies => $k] } | |||||||||||||||||||||||||||||||||||||||||
| 114 | 1 | grep { !exists $data->{$_} } @{$dependencies->{$k}}; | |||||||||||||||||||||||||||||||||||||||||
| 115 | } | ||||||||||||||||||||||||||||||||||||||||||
| 116 | |||||||||||||||||||||||||||||||||||||||||||
| 117 | 10675 | return @errors; | |||||||||||||||||||||||||||||||||||||||||
| 118 | } | ||||||||||||||||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||||||||||||||||
| 120 | 13 | *_validate_number_max = \&JSON::Validator::Schema::Draft6::_validate_number_max; | |||||||||||||||||||||||||||||||||||||||||
| 121 | 13 | *_validate_number_min = \&JSON::Validator::Schema::Draft6::_validate_number_min; | |||||||||||||||||||||||||||||||||||||||||
| 122 | 13 | *_validate_type_array = \&JSON::Validator::Schema::Draft6::_validate_type_array; | |||||||||||||||||||||||||||||||||||||||||
| 123 | 13 | *_validate_type_array_items = \&JSON::Validator::Schema::Draft4::_validate_type_array_items; | |||||||||||||||||||||||||||||||||||||||||
| 124 | 13 | *_validate_type_array_min_max = \&JSON::Validator::Schema::Draft4::_validate_type_array_min_max; | |||||||||||||||||||||||||||||||||||||||||
| 125 | 13 | *_validate_type_array_unique = \&JSON::Validator::Schema::Draft4::_validate_type_array_unique; | |||||||||||||||||||||||||||||||||||||||||
| 126 | 13 | *_validate_type_object = \&JSON::Validator::Schema::Draft6::_validate_type_object; | |||||||||||||||||||||||||||||||||||||||||
| 127 | 13 | *_validate_type_object_min_max = \&JSON::Validator::Schema::Draft4::_validate_type_object_min_max; | |||||||||||||||||||||||||||||||||||||||||
| 128 | 13 | *_validate_type_object_names = \&JSON::Validator::Schema::Draft6::_validate_type_object_names; | |||||||||||||||||||||||||||||||||||||||||
| 129 | 13 | *_validate_type_object_properties = \&JSON::Validator::Schema::Draft4::_validate_type_object_properties; | |||||||||||||||||||||||||||||||||||||||||
| 130 | |||||||||||||||||||||||||||||||||||||||||||
| 131 | 13 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 132 | |||||||||||||||||||||||||||||||||||||||||||
| 133 | =encoding utf8 | ||||||||||||||||||||||||||||||||||||||||||
| 134 | |||||||||||||||||||||||||||||||||||||||||||
| 135 | =head1 NAME | ||||||||||||||||||||||||||||||||||||||||||
| 136 | |||||||||||||||||||||||||||||||||||||||||||
| 137 | JSON::Validator::Schema::Draft201909 - JSON-Schema Draft 2019-09 | ||||||||||||||||||||||||||||||||||||||||||
| 138 | |||||||||||||||||||||||||||||||||||||||||||
| 139 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||||||||||||||||
| 140 | |||||||||||||||||||||||||||||||||||||||||||
| 141 | See L<JSON::Validator::Schema/SYNOPSIS>. | ||||||||||||||||||||||||||||||||||||||||||
| 142 | |||||||||||||||||||||||||||||||||||||||||||
| 143 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||||||||||||||||
| 144 | |||||||||||||||||||||||||||||||||||||||||||
| 145 | This class represents | ||||||||||||||||||||||||||||||||||||||||||
| 146 | L<https://json-schema.org/specification-links.html#2019-09-formerly-known-as-draft-8>. | ||||||||||||||||||||||||||||||||||||||||||
| 147 | |||||||||||||||||||||||||||||||||||||||||||
| 148 | Support for parsing the draft is not yet complete. Look at | ||||||||||||||||||||||||||||||||||||||||||
| 149 | L<https://github.com/mojolicious/json-validator/blob/master/t/draft2019-09-acceptance.t> | ||||||||||||||||||||||||||||||||||||||||||
| 150 | for the most recent overview of what is not yet supported. | ||||||||||||||||||||||||||||||||||||||||||
| 151 | |||||||||||||||||||||||||||||||||||||||||||
| 152 | Currently less than 1% of the official test suite gets skipped. Here is a list of known | ||||||||||||||||||||||||||||||||||||||||||
| 153 | limitations: | ||||||||||||||||||||||||||||||||||||||||||
| 154 | |||||||||||||||||||||||||||||||||||||||||||
| 155 | =over 2 | ||||||||||||||||||||||||||||||||||||||||||
| 156 | |||||||||||||||||||||||||||||||||||||||||||
| 157 | =item * Float and integers are equal up to 64-bit representation limits | ||||||||||||||||||||||||||||||||||||||||||
| 158 | |||||||||||||||||||||||||||||||||||||||||||
| 159 | This module is unable to say that the 64-bit number "9007199254740992.0" is the | ||||||||||||||||||||||||||||||||||||||||||
| 160 | same as "9007199254740992". | ||||||||||||||||||||||||||||||||||||||||||
| 161 | |||||||||||||||||||||||||||||||||||||||||||
| 162 | =item * unevaluatedItems | ||||||||||||||||||||||||||||||||||||||||||
| 163 | |||||||||||||||||||||||||||||||||||||||||||
| 164 | See L</unevaluatedProperties> | ||||||||||||||||||||||||||||||||||||||||||
| 165 | |||||||||||||||||||||||||||||||||||||||||||
| 166 | =item * unevaluatedProperties | ||||||||||||||||||||||||||||||||||||||||||
| 167 | |||||||||||||||||||||||||||||||||||||||||||
| 168 | L</unevaluatedItems> and L</unevaluatedProperties> needs to track what has been | ||||||||||||||||||||||||||||||||||||||||||
| 169 | validated or not using annotations. This is not yet supported. | ||||||||||||||||||||||||||||||||||||||||||
| 170 | |||||||||||||||||||||||||||||||||||||||||||
| 171 | =item * $recursiveAnchor | ||||||||||||||||||||||||||||||||||||||||||
| 172 | |||||||||||||||||||||||||||||||||||||||||||
| 173 | Basic support for C<$recursiveRef> is supported, but using it together with | ||||||||||||||||||||||||||||||||||||||||||
| 174 | C<$recursiveAnchor> is not. | ||||||||||||||||||||||||||||||||||||||||||
| 175 | |||||||||||||||||||||||||||||||||||||||||||
| 176 | =back | ||||||||||||||||||||||||||||||||||||||||||
| 177 | |||||||||||||||||||||||||||||||||||||||||||
| 178 | =head1 ATTRIBUTES | ||||||||||||||||||||||||||||||||||||||||||
| 179 | |||||||||||||||||||||||||||||||||||||||||||
| 180 | =head2 specification | ||||||||||||||||||||||||||||||||||||||||||
| 181 | |||||||||||||||||||||||||||||||||||||||||||
| 182 | my $str = $schema->specification; | ||||||||||||||||||||||||||||||||||||||||||
| 183 | |||||||||||||||||||||||||||||||||||||||||||
| 184 | Defaults to "L<https://json-schema.org/draft/2019-09/schema>". | ||||||||||||||||||||||||||||||||||||||||||
| 185 | |||||||||||||||||||||||||||||||||||||||||||
| 186 | =head1 SEE ALSO | ||||||||||||||||||||||||||||||||||||||||||
| 187 | |||||||||||||||||||||||||||||||||||||||||||
| 188 | L<JSON::Validator::Schema>. | ||||||||||||||||||||||||||||||||||||||||||
| 189 | |||||||||||||||||||||||||||||||||||||||||||
| 190 | =cut | ||||||||||||||||||||||||||||||||||||||||||