Documentation
¶
Overview ¶
Package pyjsonschema ports python-jsonschema 4.26.0 with referencing 0.37.0 so validation errors read as Python renders them
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckSchema ¶
validator_for(schema).check_schema(schema), the first metaschema error as a SchemaError
Types ¶
type Exception ¶
Python exception the port raised, its str text fixed in Msg or rendered on demand
func (*Exception) PyTypeName ¶
Python class name of the raised exception
type IterError ¶
type IterError struct {
Message string
// Keyword that failed, nil for a false schema
Validator any
AbsolutePath []any
}
One error of an iter_errors pass with its message and absolute instance path
type SchemaError ¶
type SchemaError struct {
Message string
// contains filtered or unexported fields
}
Metaschema violation check_schema raises, Error giving the str Python renders
func (*SchemaError) Error ¶
func (e *SchemaError) Error() string
type ValidationError ¶
type ValidationError struct {
Message string
// Keyword that failed, nil for a false schema
Validator any
AbsolutePath []any
// contains filtered or unexported fields
}
Best matching jsonschema error of a validation, Error giving the str Python renders
func BestMatch ¶
func BestMatch(instance, schema any, callerDepth int) (*ValidationError, error)
validator_for, check_schema and best_match over iter_errors run from callerDepth Python frames deep, nil when valid
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string