Open karenetheridge opened 4 years ago
For using the test suite (via Test::JSON::Schema::Acceptance), see the 'additional_resources' attribute, where referenced content can be found.
All of the files (recursively) under this directory should be made available under the URI 'http://localhost:1234'. (Either create a standalone http server on localhost:1234, or create a local useragent to be provided to the implementation which only answers to requests made to resources using that URI.)
if a $ref is encountered to an unknown resource, then the uri must be absolute for it to be loadable -- because the scheme is needed to determine how the fetch is done.
when loading YAML files, set $YAML::XS::Boolean = 'JSON::PP'
.
loading with YAML::XS will not give us proper NVs and IVs until https://github.com/ingydotnet/yaml-libyaml-pm/issues/68 is resolved.
YAML workaround, for now:
use YAML::PP;
my $schema = YAML::PP->new(boolean => 'JSON::PP')->load_file($filename);
see §9.5.1.3 - when fetching a URI resource, set the User-Agent and From headers appropriately, and use/respect caching headers (potentially storing those headers in the Document object as an attribute)
Need to keep an object-scoped list of the stack of URIs in progress of being loaded -- so we don't run into circular references.
e.g. from disk or the network. requires #7.