openapi-to-postman icon indicating copy to clipboard operation
openapi-to-postman copied to clipboard

No way to exclude some tags from Postman collection

Open sudoku-lord opened this issue 3 years ago • 2 comments

When I set the folderStrategy for my Postman collection to Tags, all the tags show up as folders in the collection––even x-traitTags which have no endpoints associated with them. I looked through the options and couldn't find a way to exclude those tags from the collection.

I need to use folderStrategy=tags. If I use paths, some endpoints (which only have 1 operation each) are left hanging without folders.

Am I missing something––is there a way to control which tags are included in a collection?

sudoku-lord avatar Jun 30 '21 21:06 sudoku-lord

@sudoku-lord Currently, all the tags that are mentioned in the specification will be converted to folders even if they are not used in operations. Also, there are no options present that can configure this behavior.

As for x-traitTags, it's a vendor extension and we haven't added support for it in this module. Can you confirm if this behavior makes sense where tag objects with x-traitTags defined as false will not be included as a folder under collection?

VShingala avatar Jul 22 '21 05:07 VShingala

@sudoku-lord

openapi-to-postman focusses on the conversion of the OpenAPI document to a ready-to-use Postman collection.

You can use a NPM package from the Openapi tooling community:

These packages allow you to filter and alter the OpenAPI document before you let openapi-to-postman convert it into a Postman collection.

example:

$ npx openapi-format openapi.yaml -o openapi-formatted.yaml --filterFile customFilter.yaml

where the customFilter.yaml would contain a combination of all the elements you want to filter out, which in your case would be something linke

customFilter.yaml >>

flags:
    - x-traitTags

At least that is how I do it.

thim81 avatar Jul 24 '21 13:07 thim81