---
name: "JSON::Schema::Modern::Vocabulary"
section: "3pm"
platform: "linux"
package: "libjson-schema-modern-perl"
version: "0.611-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/JSON::Schema::Modern::Vocabulary"
---

# JSON::Schema::Modern::Vocabulary(3pm)

Base role for JSON Schema vocabulary classes

## NAME

JSON::Schema::Modern::Vocabulary - Base role for JSON Schema vocabulary classes

## VERSION

version 0.611

## SYNOPSIS

```
  package MyApp::Vocabulary::Awesome;
  use Moo;
  with 'JSON::Schema::Modern::Vocabulary';
```

## DESCRIPTION

This package is the role which all all vocabulary classes for JSON::Schema::Modern must compose, describing the basic structure expected of a vocabulary class.

## ATTRIBUTES

## METHODS

### vocabulary

Returns the canonical URI(s) describing the vocabulary for each draft specification version, as described in JSON Schema Core Meta-specification, section 8.1.2 \<https://json-schema.org/draft/2020-12/json-schema-core.html#rfc.section.8.1.2\>. Must be implemented by the composing class.

### evaluation\_order

Returns a positive integer, used as a sort key for determining the evaluation order of this vocabulary. If not overridden in a custom vocabulary class, its evaluation order will be after all built-in vocabularies. You probably don't need to define this.

### keywords

Returns the list of keywords defined by the vocabulary. Must be implemented by the composing class.

### traverse

Traverses a subschema. Callers are expected to establish a new `$state` scope.

### traverse\_subschema

Recursively traverses the schema at the current keyword, as in the `"not"` keyword.

### traverse\_array\_schemas

Recursively traverses the list of subschemas at the current keyword, as in the `"allOf"` keyword.

### traverse\_object\_schemas

Recursively traverses the (subschema) values of the object at the current keyword, as in the `$defs` keyword.

### traverse\_property\_schema

Recursively traverses the subschema under one property of the object at the current keyword.

### eval

Evaluates a subschema. Callers are expected to establish a new `$state` scope.

### eval\_subschema\_at\_uri

Resolves a URI to a subschema, then evaluates that subschema (essentially the `$ref` keyword).

## 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"` and `"irc.libera.chat"`.

You can also find me on the JSON Schema Slack server \<https://json-schema.slack.com\> and 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.
