Hi,
I have two routes in group:
g.GET("/dictionary/skills", api.GetSkills)
g.GET("/dictionary/:name", api.GetDictionary)
When I call /dictionary/skills or /dictionary/type it work as expected, but when I call /dictionary/status router returns 404. I believe this is because matching work only on first letter for speed sake. When I remove /dictionary/skills route /dictionary/status work normal.
I think this is wrong behaviour, because I want to have common handler on all /dictionary/:name but for exception add only /dictionary/skills.
I think it should be some behaviour due to your code. As example:
e := echo.New()
g := e.Group("/g")
g.GET("/dictionary/skills", func(ctx echo.Context) error {
return ctx.String(200, "skills")
})
g.GET("/dictionary/:name", func(ctx echo.Context) error {
return ctx.String(200, ctx.Param("name"))
})
Routers are working fine.
Yes your example work as expected! Thank you for it. I will try figure out source of problem and write later.
Please check this exmaple. For me http://localhost:8001/g/dictionary/status return Not Found but http://localhost:8001/g/dictionary/type return type. If remove g.GET("/server", than status request work as expected.
e := echo.New()
g := e.Group("/g")
g.GET("/dictionary/skills", func(ctx echo.Context) error {
return ctx.String(200, "skills")
})
g.GET("/dictionary/:name", func(ctx echo.Context) error {
return ctx.String(200, ctx.Param("name"))
})
g.GET("/server", func(ctx echo.Context) error {
return ctx.String(200, "server")
})
Hi @vishr, do you have any thought about this error?
@sokolovstas I believe this issue is related to #675. I will work on it asap.
@sokolovstas please verify
Yes it working fine now! Many thanks for your efforts!
Most helpful comment
Please check this exmaple. For me
http://localhost:8001/g/dictionary/statusreturnNot Foundbuthttp://localhost:8001/g/dictionary/typereturntype. If removeg.GET("/server",thanstatusrequest work as expected.