question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RESTEasy reactive endpoint 404

See original GitHub issue

Describe the bug

When two endpoint with similar URI’s are created, one of them returns 404. Ex: /device-features/{featureId}/permissions /device-features/{featureId}/actions

Expected behavior

Both Endpoints return 200

Actual behavior

No response

How to Reproduce?

https://github.com/victor-costa-avancee/resteasy_path_reproducer

Output of uname -a or ver

Darwin MBP-de-Vic.localdomain 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:06:51 PST 2021; root:xnu-7195.81.3~1/RELEASE_ARM64_T8101 arm64

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.1.1.Final

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

No response

Additional information

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
stuartwdouglascommented, Aug 16, 2021

Actually you are completely right, I was thinking about how our implementation was working rather than properly reading the spec (unfortunately the algorithm as described in the spec is super slow, so you can’t just implement it directly).

https://github.com/quarkusio/quarkus/pull/19355 will actually take care of this one as well.

0reactions
victor-costa-avanceecommented, Aug 13, 2021

But shouldn’t Regex(/device-features/{featureId}/permissions) be filtered out in step c) when matching against the request? This is what I understood after looking at the JAX-RS 2.1 spec for the first stage of request matching:

Input U = "/device-features/123/actions"

1.a  E = {}

1.b  Add regular expressions of each root resource to E
       R("/device-features/{featureId}/permissions") = "\/device-features\/([^\/]+?)\/permissions(\/.*)?"
       R("/device-features") = "\/device-features(\/.*)?"
  so E = { "\/device-features\/([^\/]+?)\/permissions(\/.*)?",  "\/device-features(\/.*)?" } 

1.c  Filter E by matching each element against U
  so E = { "\/device-features(\/.*)?" }

1.d  Ignore this step since E isn't empty

1.e  No need to sort since E only has one element

1.f  Rmatch = E[0] = "\/device-features(\/.*)?"
      Rmatch then maps back to the DeviceFeatures root resource, so each of it's endpoints can 
      then be trialed in the future steps
Read more comments on GitHub >

github_iconTop Results From Across the Web

Writing REST Services with RESTEasy Reactive - Quarkus
This is the reference guide for RESTEasy Reactive. For a more lightweight ... You can now write your first endpoint in the org.acme.rest....
Read more >
Quarkus Reactive Rest: how to throw NotFoundException for ...
I was expecting Quarkus to handle NotFoundException and return a response with 404 status code without having exception in app log.
Read more >
Home of Quarkus Cheat-Sheet - GitHub Pages
A RESTEasy Reactive-based REST Client extension. You only need to replace the quarkus-rest-client to quarkus-rest-client-reactive . Multipart.
Read more >
Build a REST API from the ground up with Quarkus 2.0
Learn how to build REST APIs from start to finish with Quarkus 2.0. This tutorial touches on improvements from older versions and includes ......
Read more >
How to Return 404 with Spring WebFlux - Baeldung
With Spring 5, we can define endpoints in a functional way, so, we can change the default HTTP status programmatically as well:
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found