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:
JsonSchemaDefinitionExceptionAll 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:
JsonSchemaDefinitionExceptionAll 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:
JsonSchemaDefinitionExceptionAll 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:
JsonSchemaValueExceptionReport violations of a given JSON schema.
This class extends
JsonSchemaValueExceptionby adding the following properties:summary: an improved version of theJsonSchemaValueExceptionerror 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
loggingconfiguration the exception message will be onlysummary(default) or a combination ofsummaryanddetails(when the logging level is set tologging.DEBUG).- details = ''¶
- summary = ''¶