-
Notifications
You must be signed in to change notification settings - Fork 110
feat(new source): add parse_yaml function
#1602
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
base: main
Are you sure you want to change the base?
Conversation
Adds `parse_yaml` function as per discussion in vectordotdev#1601. - New feature - No breaking change Sibling doc PR: vectordotdev/vector#24479 Tested with: ``` ./scripts/checks.sh ```
thomasqueirozb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this!
| //use serde_yaml::{ | ||
| // //Error, | ||
| // //value::{Value as YamlValue}, | ||
| //}; | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove this
| //use serde_yaml::{ | |
| // //Error, | |
| // //value::{Value as YamlValue}, | |
| //}; |
| }] | ||
| } | ||
|
|
||
| fn examples(&self) -> &'static [Example] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These examples are fine but they're missing an actual yaml like you'd expect to see. Something like what you did in the complex_yaml test would be nice to have here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I struggled with a raw string inside another since rust is not my primary programming language. What's the best way to do it without the compiler complaining about the extra hashes?
| seahash = { version = "4", optional = true } | ||
| serde = { version = "1", features = ["derive"], optional = true } | ||
| serde_json = { version = "1", default-features = false, optional = true, features = ["std", "raw_value"] } | ||
| serde_yaml = { version = "0.9.34" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This library is now unmaintained. I think we should use either serde_yaml_ng or serde_norway instead. I haven't looked too deeply into them to know which one is better maintained
Adds
parse_yamlfunction as per discussion in #1601.Sibling doc PR: vectordotdev/vector#24479
Tested with: