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

JAX RS kind of overlapping paths not reachable #34967

Closed
yvespp opened this issue Jul 24, 2023 · 1 comment
Closed

JAX RS kind of overlapping paths not reachable #34967

yvespp opened this issue Jul 24, 2023 · 1 comment
Labels
kind/bug Something isn't working triage/duplicate This issue or pull request already exists

Comments

@yvespp
Copy link

yvespp commented Jul 24, 2023

Describe the bug

Not sure if this is a according to the spec or a bug.

If @Path on a class (TestSubApi) overlaps the combination of @Path on class and @Path on a method of another class (TestApi), the method of the second class (TestApi) isn't reachable.

Paths: on class + on method

  • TestApi: /test + /{name} -> not reachable (404)
  • TestSubApi: /test/{name}/ + config -> works

Expected behavior

As the path don't overlap all methods/paths should be reachable.

Actual behavior

No response

How to Reproduce?

Run this service:

import jakarta.enterprise.context.ApplicationScoped;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.core.Response;

@ApplicationScoped
@Path("/test")
public class TestApi {
    @Path("/{name}")
    @GET
    public Response getName(String name) {
        return Response.ok().entity(name).build();
    }
}

@ApplicationScoped
@Path("/test/{name}")
class TestSubApi {
    @Path("/config")
    @GET
    public Response getConfig(String name) {
        return Response.ok().entity("Config of " + name).build();
    }
}

/test/{name} can't be called and returns a 404. /test/{name}/config works

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

3.2.0.Final

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

No response

Additional information

If all the code is in one class with a common @Path everything works.
If both classes use @Path("/") and the full path on the methods it works as well.

As the code in my project that is broken is generated, it's a bit laborious to change the paths.

@yvespp yvespp added the kind/bug Something isn't working label Jul 24, 2023
@geoand
Copy link
Contributor

geoand commented Jul 25, 2023

This is essentially a duplicate of #26496

@geoand geoand closed this as not planned Won't fix, can't repro, duplicate, stale Jul 25, 2023
@geoand geoand added the triage/duplicate This issue or pull request already exists label Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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