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

@Path mismatch on quarkus-rest vs quarkus-resteasy with regex #44242

Closed
jorsol opened this issue Oct 31, 2024 · 1 comment
Closed

@Path mismatch on quarkus-rest vs quarkus-resteasy with regex #44242

jorsol opened this issue Oct 31, 2024 · 1 comment
Labels
area/rest kind/bug Something isn't working

Comments

@jorsol
Copy link
Contributor

jorsol commented Oct 31, 2024

Describe the bug

When @Path("{name: [a-z0-9]+((\\.|_|__|-+)[a-z0-9]+)*(\\/[a-z0-9]+((\\.|_|__|-+)[a-z0-9]+)*)*}/hello") is used on a rest endpoint, with the quarkus-rest (reactive) extension, it does not match paths like "/lib/proj__ect-v1.0/hello/" and the endpoint is not found (404).

Expected behavior

Using quarkus-resteasy (classic) it does match correctly.

It should match the regular expression and find the endpoint correctly, at least it should behave consistently with quarkus-resteasy.

Actual behavior

On quarkus-rest it does not match returning a 404.

How to Reproduce?

Change between quarkus-resteasy and quarkus-rest:

@Path("/")
public class GreetingResource {
    @Path("{name: [a-z0-9]+((\\.|_|__|-+)[a-z0-9]+)*(\\/[a-z0-9]+((\\.|_|__|-+)[a-z0-9]+)*)*}/hello")
    @GET
    @Produces(MediaType.TEXT_PLAIN)
    public String hello(@PathParam("name") String name) {
        return "Hello " + name;
    }
}
@QuarkusTest
class GreetingResourceTest {
    @Test
    void testHelloEndpoint() {
        given()
        .when().get("/lib/proj__ect-v1.0/hello/")
          .then()
             .statusCode(200)
             .body(is("Hello lib/proj__ect-v1.0"));
    }
}

Output of uname -a or ver

6.11.5-300.fc41.x86_64

Output of java -version

java 23.0.1 2024-10-15

Quarkus version or git rev

3.16.1

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

Apache Maven 3.9.9

Additional information

No response

@jorsol jorsol added the kind/bug Something isn't working label Oct 31, 2024
@jorsol jorsol changed the title Path mismatch on quarkus-rest vs quarkus-resteasy @Path mismatch on quarkus-rest vs quarkus-resteasy with regex Nov 1, 2024
@jorsol
Copy link
Contributor Author

jorsol commented Nov 6, 2024

Duplicate of #42687

@jorsol jorsol closed this as not planned Won't fix, can't repro, duplicate, stale Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/rest kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants