swagger-combine icon indicating copy to clipboard operation
swagger-combine copied to clipboard

Name conflict in definitions

Open ctrl-Felix opened this issue 2 years ago • 1 comments

I am currently trying to combine a couple of different swagger files.

Now I keep getting Name conflict in definitions Because some swagger files have the same definitions. Is there a possibility to rename or merge them?

ctrl-Felix avatar Jul 26 '22 23:07 ctrl-Felix

I don't know if is too late, buy try deleting the security definitions from each swagger file and add it dynamically by code.

Like:

const swaggerDocument = require('/path/to/swagger.json');
const securityDefinitions = {
    OAuth2: {
        ..... // Security definition for OAuth2
    },
};
const security = [{
  OAuth2: [], // Security for OAuth2
}];
swaggerDocument.securityDefinitions = securityDefinitions;
swaggerDocument.security = security;

RafaelBarrero avatar Nov 07 '22 15:11 RafaelBarrero