You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ yq eval --help | grep input-format
-p, --input-format string [auto|a|yaml|y|props|p|xml|x|tsv|t|csv|c|toml] parse format for input. Note that json is a subset of yaml. (default "auto")
$ echo $'"foo"\n"bar"' | yq -p json -o json
"foo"
"bar"
$ echo $'"foo"\n"bar"' | yq -p auto -o json
"foo"
Error: bad file '-': yaml: line 1: did not find expected <document start>
Expected behavior -p json is not expected to make a difference, or indeed to be accepted, according to the help text. If you ask me, a sequence of JSON objects should be parsed under -p auto, even without YAML document separators.
Additional context
The difference is of course that -p json does not insist on YAML document separators. This should be documented.
The text was updated successfully, but these errors were encountered:
Describe the bug
Version of yq: 4.35.2
Operating system: windows/
Input Json
"foo"
"bar"
Command
The command you ran:
Expected behavior
-p json
is not expected to make a difference, or indeed to be accepted, according to the help text. If you ask me, a sequence of JSON objects should be parsed under-p auto
, even without YAML document separators.Additional context
The difference is of course that
-p json
does not insist on YAML document separators. This should be documented.The text was updated successfully, but these errors were encountered: