I have imported an API from swagger-UI and able to create an api and product,But when I am trying to publish ,I am getting this error. Cannot have multiple operations with the same operationId: clearCache Cannot have multiple operations with the same operationId: getConfigurationJSON any help would be appreciated.
2 Answers
As stated in the error message, each operationId must be unique across all operations. This is further explained in the following Swagger-API issue and specification:
https://github.com/swagger-api/swagger-editor/issues/1146
https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#fixed-fields-5
operationId: Unique string used to identify the operation. The id MUST be unique among all operations described in the API. Tools and libraries MAY use the operationId to uniquely identify an operation, therefore, it is recommended to follow common programming naming conventions.

- 2,122
- 1
- 14
- 25
-
2I'm getting this error when I'm adding same operation name in post and put method. I have 3 endpoints get, post, put. still, I'm wondering why I'm not getting this error with Get & Post method. – Pankaj Rawat May 01 '18 at 04:52
If you add the --skip-validation flag only one of the getByID operations will be generated https://github.com/swagger-api/swagger-editor/issues/1146#issuecomment-270006562

- 16,052
- 31
- 116
- 182