Skip to content
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

shyaml requires at least one key to check for missing key #62

Open
andrewv99 opened this issue Jan 13, 2021 · 0 comments
Open

shyaml requires at least one key to check for missing key #62

andrewv99 opened this issue Jan 13, 2021 · 0 comments

Comments

@andrewv99
Copy link

Version: shyaml 0.6.1

cat <<EOF > test1.yaml
# a:
EOF

shyaml get-value a '' < test1.yaml
Error: invalid path 'a', can't query subvalue 'a' of a leaf (leaf value is None).

cat <<EOF > test2.yaml
# a:
b: 1
EOF

shyaml get-value a '' < test2.yaml

# (empty output -> no error)

I would expect test1.yaml with no keys to be able to be queried for a non existent key, when supplying a default value, and return an empty result - not an error. It appears the document must have at least one key defined for the test to be successful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant