Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

not support this ? #1132

Closed
jicg opened this issue Oct 17, 2017 · 1 comment · Fixed by #2663
Closed

not support this ? #1132

jicg opened this issue Oct 17, 2017 · 1 comment · Fixed by #2663

Comments

@jicg
Copy link

jicg commented Oct 17, 2017

orderRouter := offline.Group("order")
{
	orderRouter.GET("", order.QueryOrders)
	orderRouter.POST("", order.Add)
	orderRouter.GET("/:id", order.GetById)
	orderRouter.PATCH("/:id", order.Patch)
	payRouter := orderRouter.Group("wxpay")
	{
	        payRouter.GET("/:id", order.WxPay)
	}
}

errors:

path segment 'wxpay/:id' conflicts with existing wildcard ':id' in path '/v1/offline/order/wxpay/:id'

why????

@nazwa
Copy link

nazwa commented Oct 30, 2017

This has been discussed so many times before. I suggest have a search for "wildcard" in issues.

It's a limitation of the underlying routing logic that doesn't rely on regular expressions for improved performance. In essence, all routes need to be "unique". /:id is is ambiguous in relation to /wxpay/:id because /:id potentially covers both paths.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
2 participants