-
-
03 May 2022 03:35:08 UTC
- Distribution: JSON-Schema-Modern
- Module version: 0.552
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues (28)
- Testers (67 / 0 / 0)
- Kwalitee
Bus factor: 1- 92.67% Coverage
- License: perl_5
- Perl: v5.20.0
- Activity
24 month- Tools
- Download (160.86KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- B
- Carp
- Exporter
- Feature::Compat::Try
- File::ShareDir
- Getopt::Long::Descriptive
- JSON::MaybeXS
- JSON::PP
- List::Util
- MIME::Base64
- Module::Runtime
- Mojo::JSON::Pointer
- Mojo::URL
- Mojolicious
- Moo
- Moo::Role
- MooX::HandlesVia
- MooX::TypeTiny
- Path::Tiny
- Ref::Util
- Safe::Isa
- Scalar::Util
- Storable
- Sub::Install
- Types::Standard
- constant
- experimental
- if
- namespace::clean
- open
- overload
- strict
- strictures
- warnings
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
JSON::Schema::Modern::Annotation - Contains a single annotation from a JSON Schema evaluation
VERSION
version 0.552
SYNOPSIS
use JSON::Schema::Modern; my $js = JSON::Schema::Modern->new; my $result = $js->evaluate($data, $schema); my @annotations = $result->annotations; my $value = $annotations[0]->annotation; my $instance_location = $annotations[0]->instance_location; my $annotations_encoded = encode_json(\@annotations);
DESCRIPTION
An instance of this class holds one annotation from evaluating a JSON Schema with JSON::Schema::Modern.
ATTRIBUTES
keyword
The keyword that produced the annotation.
instance_location
The path in the instance where the annotation was produced; encoded as per the JSON Pointer specification (RFC 6901).
keyword_location
The schema path taken during evaluation to arrive at the annotation; encoded as per the JSON Pointer specification (RFC 6901).
absolute_keyword_location
The canonical URI or URI reference of the location in the schema where the error occurred; not defined, if there is no base URI for the schema and no
$ref
was followed. Note that this is not actually fragmentless URI in most cases, as the indicated error will occur at a path below the position where the most recent identifier had been declared in the schema. Further, if the schema never declared an absolute base URI (containing a scheme), this URI won't be absolute either.unknown
A boolean flag, indicating whether the keyword is a known vocabulary keyword or unknown.
annotation
The actual annotation value (which may or may not be a string).
METHODS
TO_JSON
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, except that
instanceLocation
andkeywordLocation
are JSON pointers, not URI fragments. (See thestrict_basic
"output_format" in JSON::Schema::Modern if the distinction is important to you.)dump
Returns a JSON string representing the error object, according to the specification.
SUPPORT
Bugs may be submitted through https://github.com/karenetheridge/JSON-Schema-Modern/issues.
I am also usually active on irc, as 'ether' at
irc.perl.org
andirc.libera.chat
.You can also find me on the JSON Schema Slack server and OpenAPI Slack server, which are also great resources for finding help.
AUTHOR
Karen Etheridge <ether@cpan.org>
COPYRIGHT AND LICENCE
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.
Module Install Instructions
To install JSON::Schema::Modern, copy and paste the appropriate command in to your terminal.
cpanm JSON::Schema::Modern
perl -MCPAN -e shell install JSON::Schema::Modern
For more information on module installation, please visit the detailed CPAN module installation guide.