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

RESTEasy Should we throw exception instead of WARN on multiple resources matching request #2080

Closed
emmanuelbernard opened this issue Apr 15, 2019 · 4 comments
Labels
area/resteasy area/user-experience Will make us lose users kind/enhancement New feature or request triage/out-of-date This issue/PR is no longer valid or relevant

Comments

@emmanuelbernard
Copy link
Member

When doing this by accident

@Path("/api")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public class TodoResource {
    @GET
    public List<Todo> getAll() {
        return Todo.listAll(Sort.by("order"));
    }

    @GET
    public List<Todo> findNotCompleted() {
        return Todo.findNotCompleted();
    }
}
2019-04-15 15:24:23,394 WARN  [org.jbo.res.res.i18n] (XNIO-1 task-2) RESTEASY002142: Multiple resource methods match request "GET /api/". Selecting one. Matching methods: [public java.util.List fr.devoxx.quarkus.tia.TodoResource.findNotCompleted(), public java.util.List fr.devoxx.quarkus.tia.TodoResource.getAll()]

Which I did not see and then got my demo all derailed.
The good news is once I looked at the console I figured it out. The bad news is that I did not look at the console since it was not fatal to my live coding.

Is there any good reason @asoldano to leave this as a warning vs stopping right away.
I'd love an option in RESTEasy set by Quarkus to fail fast.

CC @FroMage @gsmet

@gsmet gsmet added the kind/enhancement New feature or request label Apr 15, 2019
@emmanuelbernard emmanuelbernard added the area/user-experience Will make us lose users label Apr 15, 2019
@asoldano
Copy link
Contributor

@emmanuelbernard we went through few changes before that log was properly printed; we can double check if there's maybe an edge case where stopping and throwing an exception is wrong, but yeah, we can definitely have an option for that. Feel free to create a RESTEASY jira and link it here. Thanks.

@FroMage
Copy link
Member

FroMage commented Apr 15, 2019

It does sound like an exception should be the right thing to do, indeed. I can't think of a way an application would be well-defined like this.

@asoldano
Copy link
Contributor

https://issues.jboss.org/browse/RESTEASY-2220

@gsmet
Copy link
Member

gsmet commented Nov 13, 2019

This has apparently been fixed in RESTEasy 4.4.0.Final.

@gsmet gsmet closed this as completed Nov 13, 2019
@gsmet gsmet added the triage/out-of-date This issue/PR is no longer valid or relevant label Nov 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/resteasy area/user-experience Will make us lose users kind/enhancement New feature or request triage/out-of-date This issue/PR is no longer valid or relevant
Projects
None yet
Development

No branches or pull requests

4 participants