Skip to content

Multiple uri route create a double when uri attribute is not set on @Get annotation #8079

Open
@volnei

Description

@volnei

Expected Behavior

Multiple URI should resolve to exactly uris

Actual Behaviour

They are resolving to "/" also

Steps To Reproduce

Create a project with a multiple uri and create a controller like this:

@Controller("/home")
public class HomeController {

  @Get
  public String get() {
      return "resolve to / uri";
  }

  @Get(uris= {"/uri1", "/uri2"})
  public String get() {
      return "resolve wront to / uri";
  }
}

Run application locally

Call / uri

curl 'http://localhost:8080/home' -v

It should print resolve to / uri but currently prints resolve wront to / uri "

The problem go away if you use current @Get annotation configuration

@Get(uri="/uri1", uris={"/url2"})

Environment Information

MacOS (but probably any)
Java 17
Micronaut 3.6.2

Example Application

No response

Version

3.6.2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions