package JSONSchema::Validator::Draft6; # ABSTRACT: Validator for JSON Schema Draft6 use strict; use warnings; use JSONSchema::Validator::Constraints::Draft6; use parent 'JSONSchema::Validator::Draft4'; use constant SPECIFICATION => 'Draft6'; use constant ID => 'http://json-schema.org/draft-06/schema#'; use constant ID_FIELD => '$id'; sub new { my ($class, %params) = @_; my $self = $class->create(%params); my $constraints = JSONSchema::Validator::Constraints::Draft6->new(validator => $self, strict => $params{strict} // 1); $self->{constraints} = $constraints; return $self; } 1; __END__ =pod =encoding UTF-8 =head1 NAME JSONSchema::Validator::Draft6 - Validator for JSON Schema Draft6 =head1 VERSION version 0.011 =head1 SYNOPSIS $validator = JSONSchema::Validator::Draft6->new(schema => {...}); my ($result, $errors) = $validator->validate_schema($object_to_validate); =head1 DESCRIPTION JSON Schema Draft6 validator with minimum dependencies. =head1 CLASS METHODS =head2 new Creates JSONSchema::Validator::Draft6 object. $validator = JSONSchema::Validator::Draft6->new(schema => {...}); =head3 Parameters =head4 schema Scheme according to which validation occurs. =head4 strict Use strong type checks. Default value is 1. =head4 using_id_with_ref Consider key C<$id> to identify subschema when resolving links. For more details look at json schema docs about L and L. =head4 scheme_handlers At the moment, the validator can load a resource using the http, https protocols. You can add other protocols yourself. sub loader { my $uri = shift; ... } $validator = JSONSchema::Validator::Draft6->new(schema => {...}, scheme_handlers => {ftp => \&loader}); =head1 METHODS =head2 validate_schema Validate object instance according to schema. =head1 AUTHORS =over 4 =item * Alexey Stavrov =item * Ivan Putintsev =item * Anton Fedotov =item * Denis Ibaev =item * Andrey Khozov =back =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2021 by Alexey Stavrov. This is free software, licensed under: The MIT (X11) License =cut