Here's a script that claims a valid object is invalid. As you can see, I'm using perl's native booleans:
use v5.42;
use JSON::Validator;
my $jv = JSON::Validator->new;
$jv->coerce('booleans');
$jv->schema({
type => 'object',
properties => {
v => {
type => 'boolean',
const => true,
}
}
});
my @errors = $jv->validate({ v => 1 });
say foreach @errors;
say 'ALL OK' if ! @errors;
Same thing happens if I replace const => true with enum => [true].
Also true doesn't validate against const => true, when booleans are coerced.
Here's a script that claims a valid object is invalid. As you can see, I'm using perl's native booleans:
Same thing happens if I replace
const => truewithenum => [true].Also
truedoesn't validate againstconst => true, when booleans are coerced.