Skip to content

Anchor map key with no space before colon works in v3; breaks in v4 #109

@mikefarah

Description

@mikefarah

Not sure if this is intentional in v4 - but this used to work in v3:

f:
  a: &a cat
  *a: b  # this specifically

Whereas v4 this no longer works - and you need a space between the anchor and colon

f:
  a: &a cat
  *a : b  # this will now work 

From what I understand the yaml standard was a little vague here - and tools like yamllint also do not like *a: blah - I'm happy enough to update the test in yq because I think this is fairly niche if anyone is doing it - just wanted to double check :)

Also this is the only test that failed when I updated to v4! mikefarah/yq#2468

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions