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

Merge securitySchemes of input files

Open andreasanta opened this issue 3 years ago • 2 comments

At the moment only the securitySchemes item from the first file parsed is taken.

This behavior is not documented and also not expected. And leads to validation errors on the final schema, in case the security key in one of the files references a schema that was not merged.

The logical implementation would be to perform a merge of all securitySchemes found across all the input files. At least a warning should be raised to inform the user and prevent blind attempts.

Thanks.

andreasanta avatar Dec 18 '21 19:12 andreasanta

I've done this now in a fork https://github.com/dbryar/openapi-merge

dbryar avatar Jul 22 '22 04:07 dbryar

I also added a deepMerge flag to disputes as API gateway will have a single IDP provider, yet microservices may require different scopes, thus they need merging, and not to be given a suffix

dbryar avatar Jul 22 '22 04:07 dbryar