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

Output when using the inverse option should be valid

ian-rose opened this issue · comments

I am using the --inverse option to output both external and internal API documentation. When I output the external documentation everything works as expected, however when I run openapi-filter with the --inverse option the output is not a validOpenAPI object. Because of this I cannot run it through a documentation generator to output human-readable documentation.

Per #1 (comment) this is a known issue. I believe there is an easy fix for the 90% use case: the openapi and info fields are required in the OpenAPI object, so these fields should always be included in the output of openapi-filter.

As per #1 this wasn't really the intended use case of the --inverse option, that was to be able to see what was being filtered out.

However, I can see an additional option being useful for the use-case you describe.

--valid option added in v1.3.0.