anirtek's avatar
Occasional Contributor
4 years ago
New Idea

Annotate a required queryParam

I am using swagger-core 2.1.9 with Jersey 3.x JAX-RS API and Jakarta namespace. I have a query that looks like


My method definition is:

public void getRecord(
                 @PathParam("featureGroup") String featureGroup, 
                 @Schema Jedis jedis, 
                 @Context HttpServletRequest request, 
                 @Context HttpServletResponse response)
            throws IOException, JedisException, JSONException {}

I want to annotate a required/notnull queryParam RecordIdentifierValueAsString as somewhere for this call. But when I do that, it says that local variable can not be annotated -

@NotNull @QueryParam("RecordIdentifierValueAsString") String recordIdentifier;

How can I annotate a query param if its not used as an argument to the method?

No CommentsBe the first to comment