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

Single node MappingValue path not set correctly #583

Open
LarsStegman opened this issue Dec 9, 2024 · 0 comments
Open

Single node MappingValue path not set correctly #583

LarsStegman opened this issue Dec 9, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@LarsStegman
Copy link

LarsStegman commented Dec 9, 2024

Describe the bug
MappingValueNode path is set incorrectly when it is the root element. I think the node should get as path $, although I am not 100% certain. At least, the behaviour is not consistent.

To Reproduce
Given this file:

x: 3

You get this AST where the path of the MappingValue is $
no dots before

Expected behavior
If there is a nested value, the root MappingValue gets a different path, $.x:

x:
  y: 3

nesting before

Version Variables

  • Go version: 1.23
  • go-yaml's Version: v1.15.7
@LarsStegman LarsStegman added the bug Something isn't working label Dec 9, 2024
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