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

YAML list state (trailing commas) seeps into next parsed object #943

Open
alamar opened this issue Oct 3, 2024 · 1 comment
Open

YAML list state (trailing commas) seeps into next parsed object #943

alamar opened this issue Oct 3, 2024 · 1 comment

Comments

@alamar
Copy link
Contributor

alamar commented Oct 3, 2024

Suppose you have a YAML file with multiple consequitive objects going like

object1:
  - !Object1 {
    list: [
      'of',
      'items'
     ] # , may go after this
   } # , may go after this

!Object2 {
  ...
}

The problem is, if a comma goes after the closing square bracket (or curly bracket?), then Object2 is going to be a part of object1 list. If it is absent, in our code base Object2 will be read as next object, but in the test that I will provid it crashes as well.

@alamar
Copy link
Contributor Author

alamar commented Oct 3, 2024

Please note that this YAML might be sligtly ill-formed - in reality it needs a --- between objects, but this causes issues as well and will have a test case of its own

alamar added a commit that referenced this issue Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant