Skip to content

Parser drops everything after empty yaml doc #451

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

Open
Cenness opened this issue Apr 10, 2025 · 0 comments
Open

Parser drops everything after empty yaml doc #451

Cenness opened this issue Apr 10, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@Cenness
Copy link

Cenness commented Apr 10, 2025

Discussion?
No

Describe the bug
On multidoc yaml input dasel drops all elements after first empty doc.

To Reproduce

  1. Create yaml
first: nonempty
---

---
second: nonempty
---
  1. Run cat md.yaml | dasel -r yaml -w yaml
  2. Get
first: nonempty

Expected behavior

$ cat md.yaml | yq
first: nonempty
---

---
second: nonempty
---

Screenshots
N/A

Desktop:

  • OS: Debian 12
  • Version: dasel version v2.8.1

Additional context

  • yq is mikefarah/yq
  • Multidoc yaml with empty docs in the middle can be seen in the wild on helm charts when entire template file is skipped due to some condition.
  • cat md.yaml | yq -o json | dasel -r json -w yaml crashes into panic, which is preferable to silently skipping payload
  • v3 panics with runtime error: invalid memory address or nil pointer dereference
@Cenness Cenness added the bug Something isn't working label Apr 10, 2025
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