validate_pyproject.errors

In general, users should expect validate_pyproject.errors.ValidationError from validate_pyproject.api.Validator.__call__.

Note that validate-pyproject derives most of its exceptions from fastjsonschema, so it might make sense to also have a look on fastjsonschema.JsonSchemaException, fastjsonschema.JsonSchemaValueException and fastjsonschema.JsonSchemaDefinitionException. )

exception validate_pyproject.errors.InvalidSchemaVersion(name: str, given_version: str, required_version: str)[source]

Bases: JsonSchemaDefinitionException

All schemas used in the validator should be specified using the same version as the toplevel schema ({version!r}).

Schema for {name!r} has version {given!r}.

exception validate_pyproject.errors.SchemaMissingId(reference: str)[source]

Bases: JsonSchemaDefinitionException

All schemas used in the validator MUST define a unique toplevel “$id”. No “$id” was found for schema associated with {reference!r}.

exception validate_pyproject.errors.SchemaWithDuplicatedId(schema_id: str)[source]

Bases: JsonSchemaDefinitionException

All schemas used in the validator MUST define a unique toplevel “$id”. $id = {schema_id!r} was found at least twice.

exception validate_pyproject.errors.ValidationError(message, value=None, name=None, definition=None, rule=None)[source]

Bases: JsonSchemaValueException

Report violations of a given JSON schema.

This class extends JsonSchemaValueException by adding the following properties:

  • summary: an improved version of the JsonSchemaValueException error message with only the necessary information)

  • details: more contextual information about the error like the failing schema itself and the value that violates the schema.

Depending on the level of the verbosity of the logging configuration the exception message will be only summary (default) or a combination of summary and details (when the logging level is set to logging.DEBUG).

details = ''
summary = ''