Ask a Question

Annotate a required queryParam

0 Kudos

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_i....

 

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?

Announcements
Welcome to the ReadyAPI Feature Requests board!

Here you can review submitted feature requests and vote up the ones you like! If you can't find the feature you want - go ahead and suggest your own idea. Ideas with the highest rating can be implemented in the product.

Check out the Create a Feature Request guide for more information.
New Here?
Welcome to the Community
Sign Up Here