Group
Extension

Matches 3

JSON-SchemaValidator ( V/VT/VTI/JSON-SchemaValidator-1.04.tar.gz, VTI, 2020; MetaCPAN )
JSON-SchemaValidator/lib/JSON/SchemaValidator.pm ( view source; MetaCPAN )
package JSON::SchemaValidator;

use strict;
use warnings;

our $VERSION = '1.04';

use B        ();
use Storable ();
require Carp;
use Time::Piece;

use JSON::SchemaValidator::Result;
use JSON::Schema
 return $self;
}

sub formats { shift->{formats} }

sub validate {
    my $self = shift;
    my ($json, $schema) = @_;

    $schema = Storable::dclone($schema);

    my $context = {
        root    =>
    };

    $self->_collect_ids($context, $schema);

    my $result = $self->_validate($context, $json, $schema);

    return $result;
}

sub _collect_ids {
    my $self = shift;
    my ($context, $sc
JSON-SchemaValidator ( V/VT/VTI/JSON-SchemaValidator-1.04.tar.gz, VTI, 2020; MetaCPAN )
JSON-SchemaValidator/lib/JSON/SchemaValidator/Pointer.pm ( view source; MetaCPAN )
package JSON::SchemaValidator::Pointer;

use strict;
use warnings;
use base 'Exporter';

our @EXPORT_OK = qw(pointer);

use URI::Escape qw(uri_unescape);

sub pointer {
    my ($json, $pointer) = @_;
ter =~ m/^#/;

    $pointer = uri_unescape($pointer);

    $pointer =~ s{^#/?}{};

    my $top = $json;
    foreach my $part (split m{/}, $pointer) {
        $part =~ s{\~1}{\/}g;
        $part =~ s{\
JSON-SchemaValidator ( V/VT/VTI/JSON-SchemaValidator-1.04.tar.gz, VTI, 2020; MetaCPAN )
JSON-SchemaValidator/lib/JSON/SchemaValidator/Result.pm ( view source; MetaCPAN )
package JSON::SchemaValidator::Result;

use strict;
use warnings;

use JSON;

sub new {
    my $class = shift;
    my (%params) = @_;

    my $self = {};
    bless $self, $class;

    $self->{errors} 
ors {
    my $self = shift;

    return $self->{errors};
}

sub errors_json {
    my $self = shift;

    return JSON::encode_json($self->{errors});
}

sub add_error {
    my $self = shift;

    if (@_

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.