nmorel/gwt-jackson-rest

addQueryParam with Collection

jufeel opened this issue · 1 comments

Hi,

I think

public RestRequestBuilder<B, R> addQueryParam( String name, Collection<Object> values);

should be changed to

public RestRequestBuilder<B, R> addQueryParam( String name, Collection<?> values);

because if your service looks like

public Map<Integer, MyBean> getForIDs(@QueryParam("id") List<Integer> idsList);

the generated code is :

public static final RestRequestBuilder<Void, Map<Integer, MyBean>> getForIDs(final List<Integer> idsList) {
    return new RestRequestBuilder<Void, Map<Integer, MyBean>>()
          .method(RequestBuilder.GET)
          .url("mypath")
          .addQueryParam("id", idsList)
          .responseConverter(getObjectReader1());
  }

but

addQueryParam( String name, Object value )

is called instead of

addQueryParam( String name, Collection<Object> values)

because Collection<Object> is not a supertype of all kinds of collections but Collection<?> should be.

Same problem with

addQueryParam( String name, Iterable<Object> values );

Thanks for your libraries.

Julien

Thanks for reporting the issue :)

It is fixed and released under version 0.4.1.