Skip to content

Invalid YAML parses successfully: indentation changed after scalar value #407

@braydonk

Description

@braydonk

Describe the bug
The following YAML is invalid:

a: 'b'
  b: 1

It is invalid because the indentation level has changed after a scalar value, which doesn't make sense.

To Reproduce
https://go.dev/play/p/WkfZUGjlNY6

Expected behavior
This yaml should be rejected with an error.

Screenshots
If applicable, add screenshots to help explain your problem.

Version Variables

  • Go version: 1.21
  • go-yaml's Version: v1.11.2

Additional context
In the playground, I show that yaml.v3 correctly rejects the invalid yaml.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions