Skip to content

conflicts with existing children in path #2289

@nicolascamilo

Description

@nicolascamilo
  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions