Last active
April 7, 2021 09:54
-
-
Save ehvattum/4e9041da47b6fe786276d796d8be8eb0 to your computer and use it in GitHub Desktop.
Requires jq. Strips example data from swagger/openapi specifications in json format. Useful if the example data contains constant changing data like dynamic dates.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jq 'walk(if type == "object" then del(.examples) | del(.example) else . end)' < spec-with-examples.json > spec-without-examples.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment