swagger-combine
swagger-combine copied to clipboard
Name conflict in definitions
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?
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;