anirtek's avatar
anirtek
Occasional Contributor
4 years ago
Status:
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 http://127.0.0.1:8080/FeatureGroup/NetflixData?RecordIdentifierValueAsString=s146&FeatureName=show_id&FeatureName=cast&FeatureName=time.

 

My method definition is:

@GET
@Path("/{featureGroup}")
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