Skip to content

Conversation

efectn
Copy link
Member

@efectn efectn commented Jan 29, 2022

If we use group in group, name of first group won't appear.

Code:

func main() {
	app := fiber.New()

	a := app.Group("/a").Name("a.")

	b := a.Group("/b").Name("b.")
	b.Get("/hello/", func(c *fiber.Ctx) error {
		return c.SendString("d")
	}).Name("c")

	data, _ := json.MarshalIndent(app.Stack(), "", "  ")
	fmt.Print(string(data))
}

Old Output:

[
  [
    {
      "method": "GET",
      "name": "b.c",
      "path": "/a/b/hello/",
      "params": null
    }
  ],
  [
    {
      "method": "HEAD",
      "name": "",
      "path": "/a/b/hello/",
      "params": null
    }
  ],
  ...
]

New Output:

[
  [
    {
      "method": "GET",
      "name": "a.b.c",
      "path": "/a/b/hello/",
      "params": null
    }
  ],
  [
    {
      "method": "HEAD",
      "name": "",
      "path": "/a/b/hello/",
      "params": null
    }
  ],
  ...
]

@ReneWerner87 ReneWerner87 merged commit d3c2122 into gofiber:master Jan 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants