Created
November 24, 2017 14:02
-
-
Save akarelas-pt/2e31f39445a039272aa33d1f6e74aa4a to your computer and use it in GitHub Desktop.
no rules returns error
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use v5.16; | |
use warnings; | |
use lib 'local/lib/perl5'; | |
use JSON::Validator; | |
use Data::Dumper; | |
my $v = JSON::Validator->new; | |
$v->schema({}); | |
my @errors = $v->validate({a => 1}); | |
print Dumper(\@errors); | |
__END__ | |
prints this: | |
$VAR1 = [ | |
bless( { | |
'path' => '/', | |
'message' => 'No validation rules defined.' | |
}, 'JSON::Validator::Error' ) | |
]; | |
However this page: http://json-schema.org/ says that schema {} allows (should allow) anything. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment