| 1 | package JSONSchema::Validator::Draft7; | ||||||||||||
| 2 | |||||||||||||
| 3 | # ABSTRACT: Validator for JSON Schema Draft7 | ||||||||||||
| 4 | |||||||||||||
| 5 | 8 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | 8 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | |||||||||||||
| 8 | 8 | ▶ | use JSONSchema::Validator::Constraints::Draft7; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 9 | |||||||||||||
| 10 | 8 | ▶ | use parent 'JSONSchema::Validator::Draft6'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 11 | |||||||||||||
| 12 | 8 | ▶ | use constant SPECIFICATION => 'Draft7'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 13 | 8 | ▶ | use constant ID => 'http://json-schema.org/draft-07/schema#'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 14 | 8 | ▶ | use constant ID_FIELD => '$id'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 15 | |||||||||||||
| 16 | 15 | ▶ | sub new { | ||||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||||
| 17 | 15 | my ($class, %params) = @_; | |||||||||||
| 18 | |||||||||||||
| 19 | 15 | my $self = $class->create(%params); | |||||||||||
| 20 | |||||||||||||
| 21 | 15 | ▶ | my $constraints = JSONSchema::Validator::Constraints::Draft7->new(validator => $self, strict => $params{strict} // 1); | ||||||||||
|
Condition50%1/2
$params{"strict"} // 1
MC/DC0%0/1
$params{"strict"} // 1
$params{"strict"}
Truth table50%1/2
A
A= $params{"strict"}
| |||||||||||||
| 22 | 15 | $self->{constraints} = $constraints; | |||||||||||
| 23 | |||||||||||||
| 24 | 15 | return $self; | |||||||||||
| 25 | } | ||||||||||||
| 26 | |||||||||||||
| 27 | 8 | 1; | |||||||||||
| 28 | |||||||||||||
| 29 | __END__ | ||||||||||||