Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implemnattion of Display for Violation #105

Open
desaikd opened this issue Jul 29, 2022 · 0 comments
Open

implemnattion of Display for Violation #105

desaikd opened this issue Jul 29, 2022 · 0 comments

Comments

@desaikd
Copy link
Contributor

desaikd commented Jul 29, 2022

Implement a Display for Violation which could represent all the violations in a nested struct form.
(Adding the type name for which the violation occurred should help direct to the root cause)

e.g.

Schema:
type::{
  name: my_int,
  type: int,
}
Input(value to be validated):
[1, 2]
{ 
   message: "value didn't satisfy type constraint(s)", 
   constraint: my_int, 
   violations: [ 
       { 
          message: "expected type Integer, found List", 
          constraint: type_constraint, 
          violations: [  ], 
          code: type_mismatched 
       } 
   ], 
   code: type_constraints_unsatisfied 
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant