goccy / go-yaml

YAML support for the Go language
MIT License
1.17k stars 131 forks source link

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

Closed braydonk closed 2 days ago

braydonk commented 1 year ago

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

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

braydonk commented 1 year ago

Very likely #358 is related

goccy commented 1 year ago

Thank you for your reporting. I'll try to fix this problem.

goccy commented 2 days ago

@braydonk Thank you for your reporting ! Also, Sorry for the late response. I've fixed this problem with latest release !