router.GET("/:something/", Blabla)
router.GET("/:something/else", Bleble)
router.GET("/:something/:different/:again", Blibli)

panic: wildcard route ':different' conflicts with existing children in path '/:something/:different/:again'

Am I doing something wrong or is this simply not allowed?

Comment From: b3lc0d3

https://github.com/gin-gonic/gin/issues/1301 , so it's not allowed

Comment From: wodim

Wow, that is terrible.

Comment From: thinkerou

expected, thanks! you should re-write your route.

Comment From: wodim

Saying it's "expected" makes it double terrible, because it means you will never get around to fix it.

There is no way Gin should confuse Bleble with Blibli: Bleble has two slashes, and Blibli has three!

In the end I had to write my own router like this:

router.GET("/", ViewHome)
router.GET("/:first", ViewRouterOne)
router.GET("/:first/:second", ViewRouterTwo)
router.GET("/:first/:second/:third", ViewRouterThree)
router.GET("/:first/:second/:third/:fourth", ViewRouterFour)

Then from those functions you can redirect requests to the correct view functions. I hope this is useful to someone.

Comment From: safwanolaimat

how this routes cause conflict

pGroup.POST("/fork", controllers.Fork)
pGroup.POST("/:id/process", controllers.processN)

Comment From: marloncristian

Am I the only one who doesn't understand why something so basic is not implemented in gin?

Comment From: wodim

https://github.com/gin-gonic/gin/issues/2016#issuecomment-523204888

Comment From: LaysDragon

Am I the only one who doesn't understand why something so basic is not implemented in gin?

me either,such basic functional route supported by most http server in the world but not in gin therefore,I have to rewrite the old openapi spec to make path can work with gin

Comment From: insomnius

How can i fix this? Where should i start to contribute to fix this?

Comment From: LaysDragon

How can i fix this? Where should i start to contribute to fix this?

It's httprouter's problem that gin currently based on checkout this issue https://github.com/gin-gonic/gin/issues/2016

Comment From: ridwanakf

is this limitation still persist now?

Comment From: appcypher

Wow! Gin routing pattern matching is a mess. Now I have to refactor my app to use another framework.

Comment From: shivamganwani

@appleboy

Member appleboy commented on Apr 8, 2021

bump to v1.7.0 version. See https://github.com/gin-gonic/gin/releases/tag/v1.7.0

Fix!!

Comment From: appleboy

@shivamganwani Thank you for classifying.