{new} @Query
The {@link oaj.http.annotation.Query @Query} annotation is used to retrieve request URL query parameters.
It's identical to {@link oaj.http.annotation.FormData @FormData}, but only retrieves the parameter from the URL string, not URL-encoded form posts.
Unlike {@link oaj.http.annotation.FormData @FormData}, using this annotation does not result in the servlet reading the contents of
URL-encoded form posts.
Therefore, this annotation can be used in conjunction with the {@link oaj.http.annotation.Body @Body} annotation or
{@link oajr.RestRequest#getBody()} method for application/x-www-form-urlencoded POST calls.
The most typical scenario is to simply use the value field to define query parameter names:
This is functionally equivalent to the following code:
The special name Map or bean.
The registered {@link oajr.RestContext#REST_partParser REST_partParser} is used to convert strings
to POJOs and controls what POJO types are supported.
By default, this is the {@link oaj.oapi.OpenApiParser} which supports the standard Swagger-based rules for parsing.
For example, the following shows how a pipe-delimited list of comma-delimited numbers (e.g. Longs:
Input will be converted based on the types and formats defined in the schema definition.
Input validations such as minLength/maxLength that don't match the input will result in automatic 400 Bad Request responses.
For more information about valid parameter types, see {@doc juneau-marshall.OpenApiDetails.Parsers OpenAPI Parsers}
The
This information is used to populate the auto-generated Swagger documentation and UI.
{@doc DefaultRestSvlVariables} (e.g. "$L{my.localized.variable}") are supported on annotation fields.