Skip to content

Conversation

@juchem
Copy link

@juchem juchem commented Jan 9, 2026

Adds parse_yaml function as per discussion in #1601.

  • New feature
  • No breaking change

Sibling doc PR: vectordotdev/vector#24479

Tested with:

./scripts/checks.sh

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
```
Copy link
Contributor

@thomasqueirozb thomasqueirozb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this!

Comment on lines +1 to +5
//use serde_yaml::{
// //Error,
// //value::{Value as YamlValue},
//};

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove this

Suggested change
//use serde_yaml::{
// //Error,
// //value::{Value as YamlValue},
//};

}]
}

fn examples(&self) -> &'static [Example] {
Copy link
Contributor

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

Copy link
Author

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" }
Copy link
Contributor

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

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

Successfully merging this pull request may close these issues.

2 participants