-
-
Notifications
You must be signed in to change notification settings - Fork 629
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
yq
does not parse property path correctly ... ?
#2266
Comments
This is not correct; the 2 YAML files are not equivalent. Rewriting them in JSON makes it obvious: { "test": { "some.data": "x" } } -- vs -- { "test": { "some": { "data": "x" } } } The dot is simply part of the key name; it does not split into a sub-object at the dot. I don't see any incorrect behaviour in this issue. |
I don't think rewriting in JSON is a valid way to prove that this is correct behavior. YML is not JSON. In YML, my examples are equivalent. |
The
Yes, this happens after YAML processing. Spring converts the YAML config into properties format before parsing it again. So both files end up as:
But that is unrelated to YAML parsing. |
Since ❯ cat test.yaml
test:
some.data: x
❯ yq -o=props test.yaml
test.some.data = x
❯ yq -o=props test.yaml | yq -p=props .test.some.data
x It turns |
Okay, I'll close this, then. Thanks. |
Describe the bug
I must be doing something wrong here as this seems very basic. It appears that nested properties are not parsed correctly? See below.
Version of yq: 4.45.1
Operating system: RHEL8
Installed via: binary
Input Yaml
test.yml:
Command
Actual behavior
Querying a compound path part (
test.some.data
) does not traverse the path.Expected behavior
Querying a compound path part (
test.some.data
) should traverse the path without the need for quoting.Additional context
The
test.yml
file above includes two ways to write nested paths. A given YAML file could look either way:-- or --
Both are valid YAML, the end user wouldn't know which format is in place within a given YAML file (without looking), so querying
test.some.data
should work for both cases.The text was updated successfully, but these errors were encountered: