Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quarkus REST. @Path conflict #43065

Closed
andreiyusupau opened this issue Sep 5, 2024 · 1 comment
Closed

Quarkus REST. @Path conflict #43065

andreiyusupau opened this issue Sep 5, 2024 · 1 comment
Labels
env/windows Impacts Windows machines kind/bug Something isn't working triage/duplicate This issue or pull request already exists

Comments

@andreiyusupau
Copy link

andreiyusupau commented Sep 5, 2024

Describe the bug

I have two resources (see example code below):
One of them specifies some path prefix for all it's method on the class level (for example /admin).
The other has no class level prefix, but has one method with same prefix (for example /admin/hello).
For some reasons /admin/hello is not resolved by Quarkus and when I call this url I get error 404.

Expected behavior

I expect that both types of urls work. (Such cases work pretty fine in Spring for example)
If it's not expected to work this way it would be good to have some compile or startup error.

Actual behavior

Only endpoint from resource with class level prefix works.

How to Reproduce?

  1. Create Quarkus app with REST module.
@Path("/admin")
public class AdminResource {

    @GET
    @Path("/action")
    @Produces(MediaType.TEXT_PLAIN)
    public String hello() {
        return "Hello from Quarkus REST";
    }
}
@Path("")
public class ExampleResource {

    @GET
    @Produces(MediaType.TEXT_PLAIN)
    @Path("/admin/hello")
    public String hello() {
        return "Hello from Quarkus REST";
    }

}
  1. Call /admin/action -> works fine
  2. Call /admin/example -> 404

Output of uname -a or ver

Microsoft Windows [Version 10.0.22631.4037]

Output of java -version

Amazon Corretto 21.0.1

Quarkus version or git rev

3.14.2

Build tool (ie. output of mvnw --version or gradlew --version)

gradle 8.10

Additional information

By the way Quarkus Dev UI shows that both endpoints are available.

@andreiyusupau andreiyusupau added the kind/bug Something isn't working label Sep 5, 2024
@quarkus-bot quarkus-bot bot added env/windows Impacts Windows machines triage/needs-triage labels Sep 5, 2024
@geoand
Copy link
Contributor

geoand commented Sep 6, 2024

I am going to close this as duplicate of #26496

@geoand geoand closed this as not planned Won't fix, can't repro, duplicate, stale Sep 6, 2024
@geoand geoand added the triage/duplicate This issue or pull request already exists label Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
env/windows Impacts Windows machines kind/bug Something isn't working triage/duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants