-
Notifications
You must be signed in to change notification settings - Fork 8k
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
wildcard path param #2754
Comments
I have already checked #2706 ,But it didn't solve my problem, Please help me to check it. thx |
What you up to? |
duplicated of #2762 ? |
This looks like it might be different from #2762. This particular case is actually not a bug but is working as designed. Basically each path element is checked, one at a time. Since If you want, you can explicitly add a route for I think this ultimately comes down to a documentation thing. We don't have much documentation about how wildcards mix with exact paths, and should probably improveme it. |
package main
import (
"fmt"
"github.com/gin-gonic/gin"
)
func handler(c *gin.Context) {
fmt.Println(c.Params)
}
func main() {
g := gin.Default()
g.GET("/:resources/:name", handler)
g.GET("/:resources", handler)
g.GET("/namespaces/:namespace", handler)
g.GET("/namespaces/:namespace/:resources/:name", handler)
g.GET("/namespaces/:namespace/:resources", handler)
g.Run(":9090")
} base on the comment |
Description
How to reproduce
Actual result
Environment
The text was updated successfully, but these errors were encountered: