-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
gin-gonic/gin
#2663Labels
Description
Hi,
I have two endpoints - one of them return entity for given group in specified version, while the other returns the latest entity for given group. Routing should look like this:
router.GET("/:group_id/latest", redirectToLatest)
router.GET("/:group_id/:version_id", entityDetails)
Right now it's no possible. Definition order does not matter.
panic: path segment 'latest' conflicts with existing wildcard ':version_id' in path '/:group_id/latest' [recovered] panic: path segment 'latest' conflicts with existing wildcard ':version_id' in path '/:group_id/latest'
I could check in entityDetails
if version_id
is latest
and that's what I do right now, but it would be way nicer to allow to define static route, even if dynamic one already cover the same case.