This is a placeholder issue that I expect to be resolved when the new ::Schema interface(s) are ironed out -- just to keep track of an issue I am running into so it is not forgotten --
if I wnat to validate a document againt a URL, I need to load it myself:
my $schema = $ua->get($url);
$jv->validate($data, $schema);
...but then I lose the benefits of the caching that is done in _load_schema_from_url (e.g. if I want to validate against the draft07 spec itself). The only alternative is to call $jv->load_and_validate_schema($url) or $jv->schema($url) which wipes out the previous schema I have stored in the $jv object. Ideally I'd like to have multiple schemas cached in a single JV, so I don't have to switch objects or re-load schemas unnecessarily.
I suspect that many of these internal methods (load*, _resolve, etc) should be made public, perhaps cleaning them up a bit to add more error checking etc. I have been reading the draft07 spec on how schema documents should be parsed, which is basically writing the new api for us :)
This is a placeholder issue that I expect to be resolved when the new ::Schema interface(s) are ironed out -- just to keep track of an issue I am running into so it is not forgotten --
if I wnat to validate a document againt a URL, I need to load it myself:
...but then I lose the benefits of the caching that is done in _load_schema_from_url (e.g. if I want to validate against the draft07 spec itself). The only alternative is to call
$jv->load_and_validate_schema($url)
or$jv->schema($url)
which wipes out the previous schema I have stored in the $jv object. Ideally I'd like to have multiple schemas cached in a single JV, so I don't have to switch objects or re-load schemas unnecessarily.I suspect that many of these internal methods (load*, _resolve, etc) should be made public, perhaps cleaning them up a bit to add more error checking etc. I have been reading the draft07 spec on how schema documents should be parsed, which is basically writing the new api for us :)