JSON::...tation(3pm)
β¨ NAME β¨
okay bestie, welcome to JSON::Schema::Modern::Annotation β it's the little container that holds one single annotation from a JSON Schema evaluation π (this one's from the User Contributed Perl Documentation manual, iykyk).
πΈ VERSION πΈ
version 0.642
ngl the version numbering here is a linear, always-increasing situation β so do not read anything into the number being less than 1.0, fr fr. No meaning should be presumed or inferred from that. Periodt.
π 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 π¦
so basically β an instance of this class holds one annotation from evaluating a JSON Schema with JSON::Schema::Modern. one annotation, one object, very demure, very mindful β¨
π ATTRIBUTES π
π keyword
the keyword that produced the annotation.
π instance_location
the path in the instance where the annotation was produced π it's encoded as per the JSON Pointer specification (RFC 6901, https://datatracker.ietf.org/doc/html/rfc6901).
π§ keyword_location
the schema path taken during evaluation to arrive at the annotation β¨ also encoded as per the JSON Pointer specification (RFC 6901, https://datatracker.ietf.org/doc/html/rfc6901).
π absolute_keyword_location
the canonical URI or URI reference of the location in the schema where the error occurred. it's not defined if there's no base URI for the schema and no $ref was followed.
heads up bestie: this is not actually a fragmentless URI in most cases, because the indicated error happens at a path below the position where the most recent identifier had been declared in the schema. and also β if the schema never declared an absolute base URI (one containing a scheme), this URI won't be absolute either. π
β unknown
a boolean flag β it tells you whether the keyword is a known vocabulary keyword or an unknown one.
π annotation
the actual annotation value π«Ά which may or may not be a string.
π depth
an integer that says how many subschemas deep this annotation was generated from. you can use it to construct a tree-like structure of annotations π³ iconic.
π₯ METHODS π₯
π TO_JSON
returns a data structure suitable for serialization β¨ it corresponds to one output unit as specified in https://json-schema.org/draft/2020-12/json-schema-core#section-12.3 and https://json-schema.org/draft/2020-12/output/schema β except that instanceLocation and keywordLocation are JSON pointers, not URI fragments, even in draft2019-09. (if that distinction matters to you, see the strict_basic output_format in JSON::Schema::Modern, which is only available in that version π)
π¦ dump
returns a JSON string representing the error object, according to the specification at https://json-schema.org/draft/2019-09/json-schema-core.html#rfc.section.10.
π«Ά GIVING THANKS π«Ά
if you found this module useful, please show your appreciation by adding a +1 on MetaCPAN (https://metacpan.org/dist/JSON-Schema-Modern) and a star on GitHub (https://github.com/karenetheridge/JSON-Schema-Modern). it's giving main character energy and it costs you nothing bestie π
πΈ SUPPORT πΈ
bugs may be submitted through https://github.com/karenetheridge/JSON-Schema-Modern/issues.
she's also usually active on irc, as 'ether' at irc.perl.org and irc.libera.chat π§
you can also find her on the JSON Schema Slack server (https://json-schema.slack.com) and the OpenAPI Slack server (https://open-api.slack.com) β 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 π
some schema files have their own licence, in share/LICENSE.
and that's the whole page bestie, no cap π
this was perl v5.40.1, dated 2026-07-31 β go forth and annotate π¦β¨
π¦ where this page comes from
- ubuntu stonking: libjson-schema-modern-perl 0.642-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms