There are multiple annotations in JAX-RS method params: @QueryParam
, @PathParam
, etc.
https://docs.oracle.com/cd/E19798-01/821-1841/6nmq2cp1v/index.html
However, these annotations are not mandatory. I have a situation when a parameter of GET method is not annotated:
@GET
@Produces(MediaType.APPLICATION_JSON)
public Map<String, Object> getProduct(
String domain,
@QueryParam("code") String code,
@QueryParam("region") String region
) {
Here domain parameter is not annotated at all. I’m not sure what it means. (It is a production code from some repository).
For POST methods this would mean that domain parameter would consume request body: How to get full REST request body using Jersey?
But what it would mean for GET method? As far as I know body does not make much sense for GET requests (i.e., it can be safely ignored according to web standard).
What is the default fallback for unannotated parameters? I did not find the answer in documentation.