3 ms·
I'm looking for a solution to filter large openapi specs to the most concise complete subset. I've implemented three different variations, two of which appear n
by bravura 2y ago
I'm looking for a solution to filter large openapi specs to the most concise complete subset. I've implemented three different variations, two of which appear not to prune enough, and one of which appears to prune too much.
Any recommendations?
- dtkav 2y agoAre you trying to prune inaccessible types or something? I'm not sure what you mean by concise complete subset, but in the past I had good success with custom rules in spectral [0]. [0] https://github.com/stoplightio/spectral https://github.com/stoplightio/spectral
- bravura 2y agoThe task: I have a massive OpenAPI spec, and I want to drop all operations except for read-only ones. I want to preserve all referenced types, but slim the YAML as much as possible and remove extraneous elements. I've tried prunes operations while preserving referenced components using redocly. I've tried openapi-extract CLI to extract only components I reference. And I've tried openapi-format CLI. They all give different results, and I can't tell whether I am pruning too much or too little. And yes I'm using spectral at the end, but it doesn't necessarily show it you're missing something that isn't referenced in the final output.
- joshgachnang 2y agoInteresting, are you trying to automatically create and use components? Or only show certain fields?