advice on looping through a yaml file and removing key starting with "x-" #2525
Unanswered
ponsakorn30214
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I'm looking to use yq to loop through an openapi specification (swagger.yaml) file and remove any key(and its value) that started with "x-", the key can be simple key/value, array and object. How should i go to accomplish this?
I've tried
yq 'with_entries(select(.key | test("^x-") | not))' swagger.yaml > swagger-kong.yamlbut it only removing the key at root level and not deeper level.Thank you in advance for the answer
Beta Was this translation helpful? Give feedback.
All reactions