title: Issue marshalling generic with Moxy and JerseyClient2
body: <p>The following code uses the Jersey2 client (v 2.22.2) with the built-in Moxy JSON support. I am trying to marshal a generified wrapper class into JSON. As you can see below the <code>json</code> property isn't unmarshalling as intended. </p>
  
  <p>When I change the type for the <code>json</code> property to <code>Service</code> and 'ungenerify' the class everything works as intended but I would prefer to be able to do this with generics so I don't have to create a bunch of these wrapper classes for each type that needs to be wrapped in this fashion. </p>
  
  <p>JSONWrapper.java</p>
  
  <pre><code>public class JSONWrapper&lt;T&gt; implements Serializable {
    private T json;
  
    public T getJson() { return this.json; }
    public void setJson (T payload) { this.json = payload; }
  
    public JSONWrapper() {}
  }
  </code></pre>
  
  <p>Service.java</p>
  
  <pre><code>public class Service implements Serializable {
      private String name;
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
  }
  </code></pre>
  
  <p>MyClient.java</p>
  
  <pre><code>public class MyClient {
    private Client jerseyClient;
  
    public void createService(Service item) {
      Invocation.Builder invocationBuilder = buildRequest(SERVICE_PATH);
      JSONWrapper&lt;Service&gt; wrapper = new JSONWrapper&lt;&gt;();
      wrapper.setJson(item);
      final Response response = invocationBuilder.post(Entity.entity(wrapper, MediaType.APPLICATION_JSON_TYPE));
    }
  
    public MyClient() {
       this.jerseryClient = ClientBuilder.newBuilder().build();
    }
  
    public static void main(String[] args) {
       MyClient myClient = new MyClient();
       Service myService = new Service();
       myService.setName("foo");
       myClient.createService(myService);
    }
  }
  </code></pre>
  
  <p>With the logging filter turned on I am seeing that Moxy's marshalling of things looks like so:</p>
  
  <blockquote>
    <p>{"json":"com.baz.Service@5674e1f2"}</p>
  </blockquote>
  
  <p>When I want it to look like so</p>
  
  <blockquote>
    <p>{"json":"{"name": "foo"}"}</p>
  </blockquote>