Mermade / openapi-filter

Filter internal paths, operations, parameters, schemas etc from OpenAPI/Swagger/AsyncAPI definitions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Inverse and valid options cause nested definitions to be removed

mcrg opened this issue · comments

Hi guys,

what I was trying to achieve with openapi-filter was to limit OpenAPI spec to resources flagged with x-internal, still keeping the whole spec valid. I used following command:
npx openapi-filter --inverse --valid --flags x-internal
Unfortunately I found that as long as it works for simple examples it does not support nested definitions/components.
On the screenshot below you can see one of your test samples adjusted to my scenario:
image
When you run above command on that sample, definitions b1, b2 and c1 won't appear in the output.

Hi guys,

I ran into this issue yesterday and decided to implement a solution taking an approach more in line with the suggestions made in the existing PR since there hasn't been any movement on it in quite some time.

Very interested in your feedback.

openapi-filter@3.0.0 has just been published.