Closed merkys closed 5 years ago
Can you extend the "Steps to reproduce the behavior" section with actual code?
Sorry for not being specific enough initially. Here is my code:
#!/usr/bin/perl
use strict;
use warnings;
use JSON;
use JSON::Validator;
use Data::Dumper;
open( my $inp, 'schema-draft07.json' );
my $json = decode_json( join( "\n", <$inp> ) );
close $inp;
my $v = JSON::Validator->new->schema( $json );
print Dumper [ $v->validate( $json, $json ) ];
where schema-draft07.json
is http://json-schema.org/draft-07/schema.
Thank you for the example code. I'll hopefully find time to look at it in the next days.
This should be fixed in 3.04, which will soon be available on CPAN.
Great, thanks!
I just ran into this on a machine that hadn't upgraded JSON::Validator in a few months...
This was fixed in commit 046cd3f3f:
+ # Do not validate against "default" in draft-07 schema
+ return if blessed $schema and $schema->isa('JSON::PP::Boolean');
I am wondering if it should also be checking the value of the boolean - i.e. if it is false, rather than true, validate should return false? or am I totally misunderstanding what is happening here?
Sorry, I don’t follow.
Steps to reproduce the behavior
Validate JSON Core meta-schema (draft-07) against itself.
Expected behavior
Successful validation.
Actual behavior