We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug According to the JSON spec (YAML is a superset of JSON), YAML 1.2.2, and YAML 1.3.0, "\/" is valid string syntax, equivalent to "/".
"\/"
"/"
However, when "\/" exists on the input to yq, the escaped character is not recognized.
yq
Version of yq: 4.13.3 Operating system: mac Installed via: go install github.com/mikefarah/yq/v4@v4.13.3 under go1.17.2 darwin/amd64
go install github.com/mikefarah/yq/v4@v4.13.3
Input
test.yml
["\/"]
Command The command you ran:
yq e '.[0]' test.yml
Actual behavior
Error: yaml: found unknown escape character
Expected behavior
/
Additional context
Optional escapes on input strings work fine with jq-1.6:
% jq -r '.[0]' test.yml /
The text was updated successfully, but these errors were encountered:
This is an issue with the underlying go-yaml parser - please raise the issue there: https://github.com/go-yaml/yaml
FWIW I created a playground example of your bug: https://play.golang.org/p/QNulMRqLfVx
Sorry, something went wrong.
Thanks! I created an issue there: go-yaml/yaml/issues/797
Ran into this issue today. When yq knows the input is json, it works correctly.
❯ cat one.json { "foo":"App\/3.2.7" } ❯ yq one.json { "foo": "App/3.2.7" } ❯ cat one.json | yq Error: bad file '-': yaml: line 2: found unknown escape character ❯ cat one.json | yq -pj foo: App/3.2.7
Looks like upstream go-yaml has been abandoned. @mikefarah Any plans to do move to different yaml lib or maintain a fork ?
No branches or pull requests
Describe the bug
According to the JSON spec (YAML is a superset of JSON), YAML 1.2.2, and YAML 1.3.0,
"\/"
is valid string syntax, equivalent to"/"
.However, when
"\/"
exists on the input toyq
, the escaped character is not recognized.Version of yq: 4.13.3
Operating system: mac
Installed via:
go install github.com/mikefarah/yq/v4@v4.13.3
under go1.17.2 darwin/amd64Input
test.yml
Command
The command you ran:
Actual behavior
Expected behavior
/
Additional context
Optional escapes on input strings work fine with jq-1.6:
% jq -r '.[0]' test.yml /
The text was updated successfully, but these errors were encountered: