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

std.parseYaml wraps result in an array when string values contain --- #1147

Closed
SamuraiPrinciple opened this issue Mar 31, 2024 · 3 comments
Closed

Comments

@SamuraiPrinciple
Copy link

SamuraiPrinciple commented Mar 31, 2024

Example:

[
  std.parseYaml('a: good--'),
  std.parseYaml('a: bad---'),
]

Produces:

[
   {
      "a": "good--"
   },
   [
      {
         "a": "bad---"
      }
   ]
]
@johnbartholomew
Copy link
Collaborator

Hi. Thanks for the bug report. Could you confirm exactly which version of jsonnet you see this behaviour with? If you've built it yourself, specifying which git commit (also how you build it would be good, since it can be configured with a bundled YAML parsing library or configured to use one from your system). If you're using a binary from somewhere else, running jsonnet --version should give some version information.

So far I have not been able to reproduce this myself, so I am probably running a different version of jsonnet.

@SamuraiPrinciple
Copy link
Author

SamuraiPrinciple commented Apr 1, 2024

Hi. Many thanks for the quick reply.

Initially, I've observed the issue on argocd which seems to be using go-jsonnet.

If I hijack one of the examples on jsonnet.org website, I'm able to reproduce it as well:

Screenshot 2024-04-01 at 15 18 05

I'm also able to reproduce it with vscode jsonnet language server plugin (that seems to be using go-jsonnet too) https://marketplace.visualstudio.com/items?itemName=Grafana.vscode-jsonnet:

Screenshot 2024-04-01 at 15 24 07

I have just realised that my local jsonnet version was actually go-jsonnet (and it's also affected) which leads me to the conclusion that I've got it wrong way around - it's most likely that only the go version is affected.

Apologies for the confusion, feel free to close the issue.

@johnbartholomew
Copy link
Collaborator

Thanks. I see you've opened google/go-jsonnet#749 so I'll close this one.

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

2 participants