Skip Menu |

This queue is for tickets about the JSON-Schema CPAN distribution.

Report information
The Basics
Id: 125196
Status: new
Priority: 0/
Queue: JSON-Schema

People
Owner: perl [...] toby.ink
Requestors: faminebadger [...] googlemail.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.016
Fixed in: (no value)



Subject: JSON::Schema can't validate the core schema against itself
From: faminebadger [...] googlemail.com
I got some kind of queue error trying to raise the ticket, and it lost what I typed. So, here it is: ---------------- In trying to validate my own schema against the core schema (http://json-schema.org/draft-07/schema#), I got the following fatal error: "Not a HASH reference at /home/famine/perl5/lib/perl5/JSON/Schema/Helper.pm line 163." So I backtracked and tried to validate the core schema against itself (which is correct - the schema defines its $schema property as itself). This failed in the same way, which is rather disappointing. This means this module doesn't work properly. A quick bit of debugging shows that the error is thrown by the "addError" sub variable defined in the "checkProp" operation, because "$schema" isn't a hash when iterating the for loop. Further debug shows me that the original error lost by the error in the addError operation was "Invalid schema/property definition 1", and that the value of both "$value" and "$schema" as passed to checkProp are the same function reference to return 1 (aka a boolean) : "bless( do{\(my $o = 1)}, 'JSON::PP::Boolean' );" I don't have a clue how to fix this, not being at all familiar with this module code, and given it's not particularly written for readability / ease of debug.