Skip to content

Instantly share code, notes, and snippets.

@astj
Created January 2, 2016 11:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save astj/c9a621574595dae78a14 to your computer and use it in GitHub Desktop.
Save astj/c9a621574595dae78a14 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
use strict;
use warnings;
use Valiemon;
use Data::Dumper;
use JSON::XS qw(decode_json);
my $content = do {
local $/;
open my $fh, '<', './v4-schema.json';
<$fh>;
};
my $data = decode_json($content);
my $valiemon = Valiemon->new($data);
my ($res, $error) = $valiemon->validate($data);
if (!$res) {
warn 'FAILED!';
warn Dumper $error;
} else {
warn 'SUCCESS!';
}
exit;
__END__
$ carton exec -- perl -Ilib sketch/schemavalidator.pl
This package support only single scope and `#/` referencing at lib/Valiemon/Attributes/Properties.pm line 29.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment