-
Notifications
You must be signed in to change notification settings - Fork 29
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
Get access to Path components #76
Comments
Please post a code example which shows what you're trying to do. How does |
@jprochazk pub struct ValidationError {
pub field: Vec<String>,
pub code: String,
} where pub fn aggregate_errors(validation_errors: &Report) -> Vec<ValidationError> {
let mut flatten_errors: Vec<ValidationError> = Vec::new();
for (path, error) in validation_errors.iter() {
let field = Vec::from_iter(path.__iter().rev().map(|(_kind, val)| val.to_string()));
flatten_errors.push(ValidationError {
code: error.message().to_string(),
field,
});
}
flatten_errors
} |
|
It's used to pass it as dict to Python code. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying to use Path to build field path like
["top_level", "0", "nested_field1"]
, it would be easy when having access toPath.components
but it's private. Can you add a possibility to access path in a different way than.to_string()
? All that needs to be done is to make__iter()
public.The text was updated successfully, but these errors were encountered: