JACKSON DATA BINDING ISSUE

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

JACKSON DATA BINDING ISSUE

yergalem
This post has NOT been accepted by the mailing list yet.
This post was updated on .
In my effort to produce java POJO to JSON mapping using Jackson Provider, I'm getting the meta data type information along with the entity (body of the response).

Whereas Jersey 2 Moxy Provider is what I used for my project, I disabled the default moxy json processor  and enabled to use Jackson.

{
    "rawType": "java.util.ArrayList",
    "type": {
        "actualTypeArguments": [
            "org.cnt.model.Client"
        ],
        "rawType": "java.util.List",
        "ownerType": null,
        "typeName": "java.util.List<org.cnt.model.Client>"
    },
    "entity": [
        {
            "clientID": 1,
            "clientUID": "CNT123",
            "firstName": "Felimon",
            "middleName": "Adane "
  }]
}


EXPECTED

 [{
            "clientID": 1,
            "clientUID": "CNT123",
            "firstName": "Felimon",
            "middleName": "Adane "
  }]

---------------------------
MY RESOURCE METHOD

        @GET @Path("/client")
        @Produces({"application/x-javascript", "application/json", "application/xml"})
        public JSONWithPadding findAllClient(@QueryParam("callback") String callback) {
               
                List<String> list=new ArrayList<String>();//Creating arraylist  
                  list.add("Yergalem");
                  list.add("Felimon");
         
            return new JSONWithPadding(new GenericEntity<List<String>>(list){}, callback);
        }


   Your help is appreciated.




Loading...