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

Enable automatic OperationID conflicts resolving #122

Open
Bohdan-Kalynovskyi opened this issue May 23, 2022 · 1 comment
Open

Enable automatic OperationID conflicts resolving #122

Bohdan-Kalynovskyi opened this issue May 23, 2022 · 1 comment

Comments

@Bohdan-Kalynovskyi
Copy link

I'm trying to merge several swagger files from similar APIs. Each swagger file contains the ping endpoint having the same OperationID:

"/ping": { "get": { "operationId": "getPing",

This results in a conflict. --continueOnError does not help, the combined file is not generated.

IMHO, my use case is rather common, so can I open a PR that would automatically rename getPing to getPing1 or fix it in any other way?

Suggestions appreciated

@odupuy
Copy link

odupuy commented May 30, 2022

In our case, we have conflicts on operation Ids, so we simply removed them before merging

    # Swagger specification https://swagger.io/specification/
    # - the operationId field must be unique, it used for the code generation but does not matter here, get rid of it
    sed -i -e "/^.*operationId:.*$/d" tmp/src/*.yaml

Look at "Renaming Path OperationIds" in https://www.npmjs.com/package/swagger-combine

if you cannot track all the conflict an automatic renaming option could be nice.

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