Created
January 6, 2026 15:54
-
-
Save elfsternberg/3f63abc874c605de0b26208188f6224c to your computer and use it in GitHub Desktop.
Shortcut Files
This file contains hidden or 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
| # From an OpenAPI Schema, extract all the schemas as an array of key/value pairs (to_entries converts them back | |
| # key/value pairs, and the `.[]` expression re-array-ifies them), get the properties of each schema and count them, | |
| # and report them in count: schema-name order; sort by the count; reverse the count so the smallest schemas are | |
| # toward the bottom | |
| $ yq '.components.schemas | to_entries | .[] | (.value.properties | length) + ": " + .key' schema.yml | sort -n | tac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment