maxdome / swagger-combine

Combines multiple Swagger schemas into one dereferenced schema.
MIT License
132 stars 36 forks source link

Support for regex in include paths #61

Closed vishnugr closed 5 years ago

vishnugr commented 5 years ago

Regex should be supported for include paths. I tried the below JSON and it doesn't include the API's that matches the regex pattern,

"apis": [ { "url": "swagger1.yaml" }, { "url": "swagger2.yaml", "paths": { "include":[ "/api/(v[0-9]*.[0-9]*)" ] } } ]

tmack8001 commented 5 years ago

This would be extremely helpful for when swagger files are onboarded or proxied under prefix whitelisted paths that a gateway would strip away before sending to the destination service provider.

tmack8001 commented 5 years ago

The major issue I see in supporting this is how the comparison of the path.method happens via a lodash native _.pick method, though generally allowing regex matching on the path would likely be very easy and provide huge benefits to people that want this.