-
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
Wrong Path Parameter Naming When Using ':' in Path #3517
Comments
Thanks for your issue. Do you mean to say that other query parameters are correctly converted? It only happens when there's a |
@johanbrandhorst Yes exactly, Query parameters are correctly converted in other requests. example:
is converted to
Please Note, this is only happening when the ":" is in the middle of the path, if I add the ":" at the end then it works.
is converted correctly to |
Thanks for the clarification. This will make it easier to fix. I think if someone wants to pick this up the first step would be to recreate this scenario in a test in https://github.com/grpc-ecosystem/grpc-gateway/blob/main/protoc-gen-openapiv2/internal/genopenapi/template_test.go. Then the fix will probably be somewhere in https://github.com/grpc-ecosystem/grpc-gateway/blob/main/protoc-gen-openapiv2/internal/genopenapi/template.go ( grpc-gateway/protoc-gen-openapiv2/internal/genopenapi/template.go Lines 1026 to 1039 in 5f9bb5c
grpc-gateway/protoc-gen-openapiv2/internal/genopenapi/template.go Lines 999 to 1008 in 5f9bb5c
|
Digged a bit into it. I think the code assumes that a "resource:action" part only occurs on the end. This PR fixes the generation for our use-case, however I'm not sure about the general impact: #3532 |
updated the PR with a test that should reproduce the issue (and a fix proposal) |
🐛 Bug Report
Plugin version
The parameters are not correctly named when the path contains
:
To Reproduce
Given a proto
api.swagger.json
Expected behavior
Expect to convert the parameter
item_no_query
to camel caseitemNoQuery
Actual Behavior
The path parameter remains in snake case instead of being converted to the camel case.
Your Environment
-Ubuntu
-Buf
-Plugin version:
[email protected]
The text was updated successfully, but these errors were encountered: