-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
The swagger plugin couldn’t distinguish two rpcs if we use the resource name design style. #702
Comments
@ch3rub1m, thanks for the detailed and interesting bug report. You have definitely run into an issue with our Swagger generation. Reading through the linked documentation, I think you're interpreting things in a valid way, but I'm not sure how we would map it in Swagger/OpenAPI land. The concept works in the gateway because it can parse the whole string and determine the match, but in Swagger it wouldn't be able do to that since name is just a string to the type system. I would be very interested at hearing alternative ways to approach this, but as of right now the only solution I see is to call the field something other than
|
@achew22, thanks for the response. I considered that the key in the Swagger generation could contain the format info, use
instead
it seems could fix this issue. |
What happens if you manually edit the Swagger to say that? |
It works if I manually edit the Swagger, but the changes will be overwritten when I generate the file next time. |
I guess that means it would be possible to edit templateToSwaggerPath and the associated tests to render that correctly. The function is very encapsulated and doesn't manipulate or depend on any external state. All you would have to do is add some test cases that match your use case. That's a very welcome change if you would be interested in taking it on. |
I'm confused. It looks like that PR is empty. What am I missing? |
@achew22 I'm sorry, I want to trigger the Travis CI again, so I used |
Sidenote on style of your proto definition, unrelated to this bug:
I'm viewing the use of |
What is the current state of this merge request? And are we sure that it won't fix this issue? Thanks! |
@frolickingferret445 I am still waiting for being merged. |
hmmm thanks! |
Issue was fixed. |
The swagger plugin couldn’t distinguish two rpcs designed according to the Google API Design Guide Resource Names as below:
The two generated results from the swagger plugin both use the
/v1/{name}
as the key.There is no problem if we use
ID
as the user input, but according to the Google API Design Guide thename
is a better choice.Is there any solution about this issue?
The text was updated successfully, but these errors were encountered: