Gin: conflicts with existing children in path

Created on 22 Mar 2020  路  1Comment  路  Source: gin-gonic/gin

  • With issues:

    • Use the search tool before opening a new issue.

    • Please provide source code and commit sha if you found a bug.

    • Review existing issues and provide feedback or react to them.

Description

Receiving "panic: wildcard route ':id' conflicts with existing children in path '/users/:id'" error

How to reproduce

    user := r.Group("/users")
    {
        user.POST("/", ur.SignUp)
        user.POST("/login", l.Login)
        user.GET("/sendconfirmationemail/:userId", rc.SendConfirmationEmail)
        user.GET("/:id", lc.GetUserByUserId)
        user.GET("/confirmemail", rc.ConfirmEmail)
        user.GET("/resendconfirmationemail", rc.ResendEmailConfirmation)
        user.GET("/forgotusername", rc.ForgotUsername)
        user.GET("/sendpasswordreset", rc.SendPasswordReset)
        user.POST("/confirmpasswordreset", rc.ConfirmPasswordReset)
    }

Expectations

Somewthing working

Actual result

wildcard error

Environment

  • go version: 1.13.18
  • gin version (or commit ref): 1.5.0
  • operating system: windows

>All comments

Was this page helpful?
0 / 5 - 0 ratings