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
type
Describe the bug Using the function type raises a lexer exception:
Error: parsing expression: Lexer error: could not match text starting at 1:5 failing at 1:7. unmatched text: "ty"
Version of yq: 4.24.5 Operating system: mac Installed via: homebrew
Input Yaml Concise yaml document(s) (as simple as possible to show the bug, please keep it to 10 lines or less) data1.yml:
- "a string" - "another string"
Command The command you ran:
yq '. | type' data1.yml
Actual behavior
Expected behavior
"array"
Additional context I've tried to compare with the output of jq:
jq
$> yq --version yq (https://github.com/mikefarah/yq/) version 4.24.5 $> jq --version jq-1.6 $> echo '[0, false, [], {}, null, "hello"]' | yq '. | type' Error: parsing expression: Lexer error: could not match text starting at 1:5 failing at 1:7. unmatched text: "ty" $> echo '[0, false, [], {}, null, "hello"]' | jq '. | type' "array"
The text was updated successfully, but these errors were encountered:
Ah I see - in yaml tags represent the type information https://yaml.org/spec/1.2.2/#3212-tags so there is a tag function.
tag
That said - I should create an alias type that calls this, which I can do in the next release. Till then, use tag.
Sorry, something went wrong.
Oh! Thanks for the explanation and the quick response!
Added type as an alias for tag #1195
90261a2
Added alias in 4.25.1
No branches or pull requests
Describe the bug
Using the function
type
raises a lexer exception:Error: parsing expression: Lexer error: could not match text starting at 1:5 failing at 1:7. unmatched text: "ty"
Version of yq: 4.24.5
Operating system: mac
Installed via: homebrew
Input Yaml
Concise yaml document(s) (as simple as possible to show the bug, please keep it to 10 lines or less)
data1.yml:
Command
The command you ran:
Actual behavior
Expected behavior
"array"
Additional context
I've tried to compare with the output of
jq
:The text was updated successfully, but these errors were encountered: