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

Key "on" mistakenly parsed #78

Closed
evertonfraga opened this issue Dec 5, 2019 · 3 comments
Closed

Key "on" mistakenly parsed #78

evertonfraga opened this issue Dec 5, 2019 · 3 comments

Comments

@evertonfraga
Copy link

evertonfraga commented Dec 5, 2019

Hi, kudos for the project. It is really useful to me.

However, i just bumped into an issue. while converting a specific key. on: gets translated to true.

Environment

  • Python versions I tested: 3.6.0, 2.7.15
  • yq version: 2.9.2
  • MacOS

Reproducible steps, using yq own test files:

curl https://raw.githubusercontent.com/kislyuk/yq/master/.github/workflows/pythonpackage.yml | yq .

Output:

{
  "name": "Python package",
  "true": [  <====== HERE
    "push"
  ],
  "jobs": {
    "build": {
…
(the rest of the output is OK)
@kislyuk
Copy link
Owner

kislyuk commented Dec 5, 2019

This is not a problem with yq, but with the YAML parser that it uses. PyYAML does not support YAML 1.2, which eliminated the broken behavior that you point out. Feel free to upvote the issue at yaml/pyyaml#116.

@evertonfraga
Copy link
Author

Much appreciated. I was now generating a test case for yq, but that won't be necessary.

upvoted.

@evertonfraga
Copy link
Author

I found an obvious workaround and I'm just posting here for documentation sake. It works when I changed on: to "on":, in the yaml file.

That works for me now, feel free to close the issue.

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