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

underscores in numbers cause json output to fail #2039

Closed
zellyn opened this issue May 13, 2024 · 1 comment
Closed

underscores in numbers cause json output to fail #2039

zellyn opened this issue May 13, 2024 · 1 comment
Labels

Comments

@zellyn
Copy link

zellyn commented May 13, 2024

Describe the bug
yq has trouble serializing numbers containing underscores to json.

Version of yq: 4.44.1
Operating system: mac
Installed via: homebrew

Command
The command you ran:

echo 'foo: 12_000' | yq -o=json

Actual behavior

Error: json: error calling MarshalJSON for type *yqlib.CandidateNode: json: error calling MarshalJSON for type *yqlib.CandidateNode: strconv.ParseInt: parsing "12_000": invalid syntax

Expected behavior

{
  "foo": 12000
}
@mikefarah
Copy link
Owner

Fixed in v4.44.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants