Skip to content

Instantly share code, notes, and snippets.

@nabsha
Created November 10, 2021 01:36
Show Gist options
  • Save nabsha/916712533edc35042d94fea653ef3bde to your computer and use it in GitHub Desktop.
Save nabsha/916712533edc35042d94fea653ef3bde to your computer and use it in GitHub Desktop.
Generate jsonpath out of yaml document
## This script generates properties files to generate json
## depends on yq https://kislyuk.github.io/yq/
## E.g input:
# ep1:
# connection:
# responseTimeout: "30"
## Output:
## "secure::ep1.connection.responseTimeout":"30",
cat <yamlfile>| yq -c 'paths(scalars) as $p | "secure::\($p|join(".")):\(getpath($p))",'
@nabsha
Copy link
Author

nabsha commented Nov 10, 2021

Make it public

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