Description
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:
test:
blah: x
some.data: z
Command
# This works correctly:
> yq -r '.test.blah' test.yml
x
# This does not (expected "z"):
> yq -r '.test.some.data' test.yml
null
# Quoting the compound path part works:
> yq -r '.test."some.data"' test.yml
z
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:
test:
some.data: x
-- or --
test:
some:
data: x
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.