Using @DefaultValue with RESTEasy Client framework

11,664

This cannot be done using the @DefaultValue annotation (Using the Client Framework).

Share:
11,664
Jean-Michel Garcia
Author by

Jean-Michel Garcia

Favourite quotes : "Unless you try to do something beyond what you have already mastered, you will never grow" - Ralph Waldo Emerson "Individual commitment to a group effort, that is what makes a team work, a company work, a society work, a civilization work” - Vince Lombardi SOreadytohelp

Updated on June 04, 2022

Comments

  • Jean-Michel Garcia
    Jean-Michel Garcia almost 2 years

    Can we use the @defaultValue annotation when using the RESTEasy client framework ?

    The compiler doesn't complain about this :

    public interface XClient {  
    
    @GET
    @Path("/rest/search")
    @Produces(MediaType.APPLICATION_XML)    
    public String getInformation(
            @QueryParam("partner") @DefaultValue("xxxxxx") String apiKey);
    }
    

    But how can I call this getInformation method without passing the apiKey parameter. In a way that the "xxxxxx" value would be taken instead.

    Is that possible or am I misunderstanding the @DefaultValue annotation purpose ?

    EDIT :

    This cannot be done using the @DefaultValue annotation. Maybe there is another solution. There is not much documentation about the client side of the RESTEasy framework.