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

Merge OpenAPI paths based on specific tags

Open osimhi213 opened this issue 9 months ago • 0 comments

Hello,

I'm currently exploring the capabilities of OpenAPI and I'm curious if there's a way to merge multiple service Swagger files while selecting only the paths that have a specific tag. I've reviewed the documentation but couldn't find any details on this particular functionality.

For instance, let's consider the following scenario: I have a merge.json file with inputs from multiple services: { "inputs": [ { "inputFile": "service1/dist/functions/api/swagger.json" }, { "inputFile": "service2/dist/functions/api/swagger.json"
}, { "inputFile": "service3/dist/functions/api/swagger.json"
} ], "output": "./dist/service.output.swagger.json" }

In this scenario, I'd like to include only the paths from service1 Swagger that comply with the "Service1" tag. Paths from service1 that don't comply with this tag should be excluded from this merged Swagger. Using the Hidden() decorator isn't suitable for my needs, as I would like to include the other tags in different merged swaggers.

Thanks in advance!

osimhi213 avatar May 26 '24 14:05 osimhi213