You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pub struct Violation {
constraint: String, // represents the constraint that created this violation
code: ViolationCode, // represents an error code that indicates the type of the violation
message: String, // represents the detailed error message for this violation
violations: Vec<Violation>,
}
It would be great if it also contained line numbers and a snippet of the content of the line that caused the error. Right now it's very difficult to figure out what caused the violation with the current context.
The text was updated successfully, but these errors were encountered:
Thanks for reaching out about this @backesj!
As per the current implementation, ion-schema-rust doesn't have Display implementation for Violation. I am working on a Display for Violation which could help make it more readable. It might not include line numbers at the moment but maybe a nested Struct with all the violations found during the validation process along with the type name that caused the violation would helpful enough to point at the root cause.
Thanks for the response! Mostly I think it would be valuable to provide line numbers and the content of the line so that users can more quickly identify the source of validation errors. This isn't in the formatted display currently, and it can be challenging to quickly locate the problem for violations that occur deep in an ION structure.
popematt
changed the title
Give move context in Violation struct
Give more context in Violation struct
Oct 18, 2022
Currently the violation struct looks like this:
It would be great if it also contained line numbers and a snippet of the content of the line that caused the error. Right now it's very difficult to figure out what caused the violation with the current context.
The text was updated successfully, but these errors were encountered: