Q: Receive two types of data from a request payload with resteasy / jax-rs I'm sending json-formatted data to my Java server via http requests.  I've had great success in receiving the requests with functions like
Boolean deleteUsers(List<Long> userIds) {
    // ...
    return true;
}

I'm using RESTEasy on a Java server, and it cheerfully converts the payload of the request into this List<Long> that's so convenient.
Now I want to send a String and a list of numbers!  Ideally, my receiving function would look something like 
Boolean deleteUsers(String string, List<Long>userIds) {
    // ....
    return true;
}

Alas, RESTEasy doesn't seem to know what I mean, and chokes on the payload.
How can I receive multiple types of data from a payload?

A: Depending on your specific use case, you might simply add the first parameter ("string") to the @Path annotation such as
@POST
@Path("{string:.*}")
@Consume(MediaType.APPLICATION_JSON)
@Produce(MediaType.APPLICATION_JSON)
Boolean deleteUsers(@PathParam("string") String string, List<Long>userIds) {
...
}

This would result in the following URL form:
/service/<string>/

with the payload containing your userid list (as json).
As you might realize, @POST method type is suggested since the service construction method won't be idempotent. Otherwise, @DELETE would have been favoured.

A: It seems that a wrapper object is needed.
class TwoObjectDTO {
    String string;
    List<Long> listOfNumbers;
}

@POST
Boolean deleteUsers(TwoObjectDTO object) {
    ...
}

