-
-
Notifications
You must be signed in to change notification settings - Fork 115
Closed
Description
I see the Rust crate's ValidationError has these fields:
jsonschema/crates/jsonschema/src/error.rs
Lines 17 to 26 in b8eef87
| pub struct ValidationError<'a> { | |
| /// Value of the property that failed validation. | |
| pub instance: Cow<'a, Value>, | |
| /// Type of validation error. | |
| pub kind: ValidationErrorKind, | |
| /// Path to the value that failed validation. | |
| pub instance_path: Location, | |
| /// Path to the JSON Schema keyword that failed validation. | |
| pub schema_path: Location, | |
| } |
instance and kind would be very useful in the Python package's ValidationError, to be able to construct our own error messages (like how fmt::Display uses the kind) and to add other logic related to the kind.
jsonschema/crates/jsonschema-py/python/jsonschema_rs/__init__.pyi
Lines 35 to 38 in b8eef87
| class ValidationError(ValueError): | |
| message: str | |
| schema_path: list[str | int] | |
| instance_path: list[str | int] |