js-yaml icon indicating copy to clipboard operation
js-yaml copied to clipboard

Unmatched quotes at the end of a value not caught as issue

Open tomacadi opened this issue 2 years ago • 0 comments

hi, it looks like having an unmatched quote at the end of a value is not caught as a syntax error.

sidecars:
  sidecars1:
    cpu: 42'

result is ok:

{
  "sidecars": {
    "sidecars1": {
      "cpu": "42'"
    }
  }
}

While this may seem harmless, it actually results in a crash on CI/CD such as harness.

having it at the beginning of the value works as expected:

sidecars:
  sidecars1:
    cpu: '42
YAMLException: unexpected end of the stream within a single quoted scalar (4:1)

 1 | sidecars:
 2 |   sidecars1:
 3 |     cpu: '42
 4 | 
-----^

tomacadi avatar Apr 25 '23 08:04 tomacadi