Skip to content

mabel.data.validator.schema

joocer edited this page Jun 4, 2021 · 3 revisions

is_boolean ()

is_cve ()

is_date ()

is_list ()

is_null ()

is_numeric ()

is_string ()

is_valid_enum ()

other_validator ()

CLASS: Schema (definition)

Tests a dictionary against a schema to test for conformity. Schema definition is similar to - but not the same as - avro schemas

Paramaters: definition: dictionary or string A dictionary, a JSON string of a dictionary or the name of a JSON file containing a schema definition

validate (subject, raise_exception)

Test a dictionary against the Schema

Parameters

  • subject - dictionary
    The dictionary to test for conformity
  • raise_exception - boolean (optional, default False)
    If True, when the subject doesn't conform to the schema a ValidationError is raised

Returns

  • boolean, True is subject conforms

Raises

  • ValidationError

This file has been automatically generated, it is not the truth. If in doubt the code will tell you unambiguously what it does.

Clone this wiki locally