You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I see many similar issues, but I can't quite find one for tracking this particular feature request to support same-branch wildcards with different names.
Problem
I'm doing some OpenAPI code generation stuff and I'd like to use the parameter names from that document to build out the router path. But sometimes, the parameter in OpenAPI don't match up with other operations in the same tree. I can't change the parameter names in this OpenAPI document, I'd like to have httprouter (or gin) support this flow.
That's an interesting scenario. In a standard REST API those two parameters should theoretically be the same. Are both routes using the same handler function as that's how it appears?
As a work-around, could you set the parameter names to both be param1. Then create a variable with the 'correct' or domain-specific param name in the handler function.
I see many similar issues, but I can't quite find one for tracking this particular feature request to support same-branch wildcards with different names.
Problem
I'm doing some OpenAPI code generation stuff and I'd like to use the parameter names from that document to build out the router path. But sometimes, the parameter in OpenAPI don't match up with other operations in the same tree. I can't change the parameter names in this OpenAPI document, I'd like to have
httprouter
(orgin
) support this flow.Example Failure
https://go.dev/play/p/6Xu_jNomZtP
httprouter/tree.go
Lines 169 to 173 in 3425025
I understand it's not supported today, but can we add support for same-path but different parameter names?
Related Issues
*
wildcard conflict with static*
wildcard conflicts with:
wildcard:
wildcardThe text was updated successfully, but these errors were encountered: