The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

JSONSchema::Validator::Draft4 - Validator for JSON Schema Draft4

VERSION

version 0.011

SYNOPSIS

    $validator = JSONSchema::Validator::Draft4->new(schema => {...});
    my ($result, $errors) = $validator->validate_schema($object_to_validate);

DESCRIPTION

JSON Schema Draft4 validator with minimum dependencies.

CLASS METHODS

new

Creates JSONSchema::Validator::Draft4 object.

    $validator = JSONSchema::Validator::Draft4->new(schema => {...});

Parameters

schema

Scheme according to which validation occurs.

strict

Use strong type checks. Default value is 1.

using_id_with_ref

Consider key $id to identify subschema when resolving links. For more details look at json schema docs about named anchors and bundling.

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::Draft4->new(schema => {...}, scheme_handlers => {ftp => \&loader});

METHODS

validate_schema

Validate object instance according to schema.

AUTHORS

  • Alexey Stavrov <logioniz@ya.ru>

  • Ivan Putintsev <uid@rydlab.ru>

  • Anton Fedotov <tosha.fedotov.2000@gmail.com>

  • Denis Ibaev <dionys@gmail.com>

  • Andrey Khozov <andrey@rydlab.ru>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2021 by Alexey Stavrov.

This is free software, licensed under:

  The MIT (X11) License