Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jaxrs-dev] Allow multiple HTTP method annotations on the same resource method?

Hi Andy,

thanks for bringing this up. To be honest, I don't like the idea of allowing different HTTP method annotations on a single resource method. Especially because it would allow weird combinations like @GET & @POST which doesn't make much sense. However, I agree that clarifying that such combinations aren't allowed would be a good thing.

Christian


Am Fr., 9. März 2018 um 20:46 Uhr schrieb Andy McCright <j.andrew.mccright@xxxxxxxxx>:
Hi All,

We had an internal customer ask whether it was allowed to use multiple method annotations on the same resource method - for example:

@Path("/somePath")
public class MyResource {

    @POST
    @PUT
    public Response postOrPut(...) {...}
}

I couldn't find anywhere in the spec where this was explicitly allowed or forbidden.  I'd be interested in hearing thoughts on whether this should be allowed or not.  I'm mostly on the fence, but leaning toward not allowing it, but I can see it's usefulness.  In either case, I think it would be good to document it to avoid ambiguity and potential portability issues.

What do you all think?

Thanks,

Andy
_______________________________________________
jaxrs-dev mailing list
jaxrs-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jaxrs-dev


--

Back to the top