-
Notifications
You must be signed in to change notification settings - Fork 73
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
3scale import openapi command fails on same operationId at different routes #222
Comments
Swagger spec does not allow same In Operation Object reference, about
Therefore, the The toolbox uses as method unique identifier:
According to the swagger spec, I think that is correct, as the toolbox can assume unique identifier among all operations. Feel free to reopen if there are further comments or unexpected behaviors |
We will review our swagger validator, as it should have rejected it before processing Thanks for the feedback |
Apicurio should catch duplicated |
@eguzki So should we open this issue again to track that? |
I have done it for you #223 |
When running
3scale import openapi
with a swagger file that contains the same method name on different route, I got an error ofFailed to create method
because it already been created by the first route. for example:{{ "swagger": "2.0", "info": { "version": "v1", "title": "WebApplication1" }, "host": "localhost:3873", "schemes": ["http"], "paths": { "/api/User": { "get": { "tags": ["User"], "operationId": "User_Get", "consumes": [], "produces": ["application/json", "text/json", "application/xml", "text/xml"], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "type": "string" } } } } } }, "/api/User/{id}": { "get": { "tags": ["User"], "operationId": "User_Get", "consumes": [], "produces": ["application/json", "text/json", "application/xml", "text/xml"], "parameters": [{ "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32" } ], "responses": { "200": { "description": "OK", "schema": { "type": "string" } } } } } }, "definitions": {} }}
First, the first route
/api/User
will create theUser_Get
method. After that,/api/User/{id}
will try to createUser_Get
method too but it fails.When I ran the command again, the import will succeed, because the method is already created and its in"update" mode.
It leads to 2 problems as I can see right now:
After more digging, I found out that if I remove the
operationId
field, the method name is being generated by the path name. So I propose it will the default always.happens with toolbox v0.13.0
The text was updated successfully, but these errors were encountered: