Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Name conflict in definitions #123

Open
ctrl-Felix opened this issue Jul 26, 2022 · 1 comment
Open

Name conflict in definitions #123

ctrl-Felix opened this issue Jul 26, 2022 · 1 comment

Comments

@ctrl-Felix
Copy link

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?

@RafaelBarrero
Copy link

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;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants