Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-2594

Documentation how to use GenericType for Collections in MicroProfile REST Client Builder

XMLWordPrintable

      It seems there is no way of using the RestEasy MicroProfileRestClient(Builder)#build(serviceInterfaceClazz) while using collections in the interface.

      public interface MyService extends Closeable {
          @GET
          @Path("/collection")
          List<String> collection();
      }
      
      MyService client = builder.build(MyService.class);
      List<String> result = client.collection();
      

      Gives the exception: RESTEASY003145: Unable to find a MessageBodyReader of content-type application/json and type interface java.util.List

      Wrapping the service interfaces return value in GenericType returns, of course, the GenericType as a result. So how to do it?

            rsearls r searls
            svenhaag Sven Haag (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: