jschon.vocabulary

class jschon.vocabulary.Applicator

A Keyword class mixin that sets up a subschema for an applicator keyword.

classmethod jsonify(parentschema, key, value)
Parameters
Return type

Optional[jschon.jsonschema.JSONSchema]

class jschon.vocabulary.ArrayApplicator

A Keyword class mixin that sets up an array of subschemas for an applicator keyword.

classmethod jsonify(parentschema, key, value)
Parameters
Return type

Optional[jschon.json.JSON]

class jschon.vocabulary.Keyword(parentschema, value)
Parameters
  • parentschema (JSONSchema) –

  • value (AnyJSONCompatible) –

__init__(parentschema, value)
Parameters
can_evaluate(instance)
Parameters

instance (jschon.json.JSON) –

Return type

bool

evaluate(instance, scope)
Parameters
Return type

None

depends: Optional[Union[str, Tuple[str, ...]]] = None
key: str = Ellipsis
types: Optional[Union[str, Tuple[str, ...]]] = None
class jschon.vocabulary.Metaschema(catalog, value, core_vocabulary, *default_vocabularies, **kwargs)

A metaschema declares the set of vocabularies that are available to any schema which references it, and provides any such schema with its Keyword classes.

Metaschema is itself a subclass of JSONSchema, and may be used to validate any referencing schema.

__init__(catalog, value, core_vocabulary, *default_vocabularies, **kwargs)
Parameters
  • catalog (Catalog) –

  • value (Mapping[str, AnyJSONCompatible]) –

  • core_vocabulary (Vocabulary) –

  • default_vocabularies (Vocabulary) –

  • kwargs (Any) –

catalog: Catalog

The catalog in which the schema is cached.

data: Union[None, bool, int, Decimal, str, List[JSON], Dict[str, JSON]]

The schema data.

JSON type

data type

boolean

bool

object

dict[str, JSON]

key: Optional[str]

The index of the schema within its parent.

keywords: Dict[str, Keyword]

A dictionary of the schema’s Keyword objects, indexed by keyword name.

parent: Optional[JSON]

The containing JSON or JSONSchema node.

session: Hashable

A session identifier, identifying which session cache to use for the schema.

type: str

The JSON type of the schema. One of "boolean", "object".

class jschon.vocabulary.PropertyApplicator

A Keyword class mixin that sets up property-based subschemas for an applicator keyword.

classmethod jsonify(parentschema, key, value)
Parameters
Return type

Optional[jschon.json.JSON]

class jschon.vocabulary.Vocabulary(uri, *kwclasses)

A vocabulary declares a set of keywords that may be used in the evaluation of JSON documents, and provides a runtime implementation (in the form of a Keyword class) for each of those keywords.

Parameters
  • uri (URI) –

  • kwclasses (KeywordClass) –

__init__(uri, *kwclasses)
Parameters