JSON::Schema::Draft201909::Error - Contains a single error from a JSON Schema evaluation
version 0.002
use JSON::Schema::Draft201909; my $js = JSON::Schema::Draft201909->new; my $result = $js->evaluate($data, $schema); my @errors = $result->errors; my $message = $errors[0]->error; my $instance_location = $errors[0]->instance_location; my $errors_encoded = encode_json(\@errors);
An instance of this class holds one error from evaluating a JSON Schema with JSON::Schema::Draft201909.
The path in the instance where the error occurred.
The schema path taken during evaluation to arrive at the error.
The path in the schema where the error occurred (may be different from keyword_location, if a $ref was followed). This is supposed to be an absolute URI (as per https://json-schema.org/draft/2019-09/json-schema-core.html#rfc.section.10.3.2) but this implementation does not yet track the absolute URIs of schemas, so it is just the fragment portion of a URI for now.
$ref
The actual error string.
Returns a data structure suitable for serialization. Corresponds to one output unit as specified in https://json-schema.org/draft/2019-09/json-schema-core.html#rfc.section.10.4.2 and https://json-schema.org/draft/2019-09/output/schema.
Bugs may be submitted through https://github.com/karenetheridge/JSON-Schema-Draft201909/issues.
I am also usually active on irc, as 'ether' at irc.perl.org and irc.freenode.org.
irc.perl.org
irc.freenode.org
Karen Etheridge <ether@cpan.org>
This software is copyright (c) 2020 by Karen Etheridge.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install JSON::Schema::Draft201909, copy and paste the appropriate command in to your terminal.
cpanm
cpanm JSON::Schema::Draft201909
CPAN shell
perl -MCPAN -e shell install JSON::Schema::Draft201909
For more information on module installation, please visit the detailed CPAN module installation guide.