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

Library cannot unmarshal its own YAML #417

Open
malcolmholmes opened this issue Jan 12, 2024 · 1 comment
Open

Library cannot unmarshal its own YAML #417

malcolmholmes opened this issue Jan 12, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@malcolmholmes
Copy link

Describe the bug
I have been using the library to write out (and then parse) Grafana dashboards. Turns out Grafana dashboards can do some horrendous things in their JSON representation. Some of these confuse this library.

There are three principal issues I've found, all to do with escaped characters in keys, which are allowed in JSON, and are also allowed in YAML (even if, I admit, a very bad idea).

The three are:

  • Newlines in keys
  • Backslashes in keys
  • Double quotes in keys

To Reproduce

Please provide a minimum yaml content that can be reproduced.

https://go.dev/play/p/F3gi3Jp4HMK

Expected behavior
The YAML/map[string]any snippets in the above code should parse without error.

Version Variables

  • Go version: 1.21.4
  • go-yaml's Version: v1.11.2 / master

I'm happy to help debug and resolve this - the Grizzly needs a decent YAML parser that can handle whatever Grafana throws at it.

@malcolmholmes
Copy link
Author

I see the go.dev link already doesn't work, bah. I converted the main.go file into proper unit tests and created a PR in #418.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant