eclipse / microprofile-open-api

Microprofile open api
Apache License 2.0
132 stars 82 forks source link

Question: Ambiguous Resource Methods in TCK, airlines UserResource #557

Closed aubi closed 1 year ago

aubi commented 1 year ago

In UserResource, two methods have the same path (e.g. refusing to deploy):

    @GET
    @Path("/{username}")
...
    public Response getUserByName(

and

    @GET
    @Path("/{id}")
...
    public Response getUserById(

The only difference is, that getUserById defines the parameter as int, while the first as String.

Is the path parameter type enough to distinguish the methods? So if the parameter is convertible to int, use getUserById; use getUserByName otherwise? To me it seems wrong, because getUserByName will never work for username made from digits.

Azquelt commented 1 year ago

Huh, I hadn't noticed this and I'm not sure if it's valid - would need to check the Jakarta RESTful WS spec for that - but it at least seems unnecessary to test something so confusing here.

Before changing it or removing one of the methods, we'd have to go through and check if any tests are expecting these entries to be present and update or remove those tests.