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

keep empty objects when converting yaml to props #2124

Closed
devopsmash opened this issue Aug 7, 2024 · 1 comment
Closed

keep empty objects when converting yaml to props #2124

devopsmash opened this issue Aug 7, 2024 · 1 comment

Comments

@devopsmash
Copy link

devopsmash commented Aug 7, 2024

I have the this yaml file foo.yaml with the following content:

a:
  aa: "foo"
  ab: {}
  ac: 123
  ad: []

When I'm trying to convert it to props it seems that yq ignores empty objects/lists.

Example:

yq -o=props foo.yaml
a.aa = foo
a.ac = 123

expected results:

yq -o=props foo.yaml
a.aa = foo
a.ab = ""
a.ac = 123
a.ad = ""

Is it something acceptable and achievable?

version: v4.40.2

@mikefarah
Copy link
Owner

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

No branches or pull requests

2 participants