(De)Serialize DateTime (Joda) with Jackson

I am building a REST webservice. Some classes have an attribute of type DateTime (JodaTime). When sending this object to my client (Javascript), my object private DateTime date; is transformed to { date: { chronology: {}, millis: 1487289600000 }...
more »

2017-06-20 13:06 (1) Answers

jsonSchema2pojo jackson deserialisation issue

I am trying use jsonSchema2pojo POJO generating library and i am successful in doing so as well. But issue i am facing is deserialisation Exception when i try to generate map by typeReferencing generated rootClass i.e EsRootDoc(in below code). Here ...
more »

2017-06-20 10:06 (0) Answers

Jackson xml and json root element

I have a service which returns objects in JSON and XML format. http://localhost:8091/apiN/xml/2 XML Result <restObjectList> <restObjectList> <restObjectList> <timestamp>2017-06-19 17:01:01</timest...
more »

2017-06-19 17:06 (1) Answers

Jackson with JodaTime and Jax-rs

I have a REST web-service created in Java. I am using Joda-time for the date and Jackson for the JSON formatting. Everything is uploaded on a Glassfish 4.1 server Versions avax.ws.rs-api-2.0.1.jar joda-time-2.7.jar jackson-annotation-2.8.8.jar jac...
more »

2017-06-19 13:06 (1) Answers

Append generated json tree

I would like to ask you for help. I have a Device object public class Device { public String name; public String deviceId; @JsonSerialize(using = CustomResourceSerializer.class) public Map<String, Map<String, Object>> cu...
more »

2017-06-18 00:06 (1) Answers

JAXB class to JSON conversion using Jackson

I have JAXB annotated class which i am trying to convert to JSON using jackson objectMapper. The issue with generated json is jackson is introduction a new property value:"xxx" for XMLValue annotation which is dont value. for example it is generated ...
more »

2017-06-17 19:06 (1) Answers

Spring boot rest ignore one class

I am developing a REST API using spring-boot-starter-data-rest. One class I want to sync with JPA is the User class containing information about users, including who is allowed to access the API. Unfortunately, having the User and the UserRepositor...
more »

2017-06-16 14:06 (3) Answers

Issue for empty string deserialization

I have an issue in my Spring projet when I call a web-service that return an object with a attribute that is an empty string. In my projet I have Spring boot 1.5.2, Spring 4.3.7 and Jackson 2.8.7. I use a RestTemplate to call web-services. Respons...
more »

2017-06-16 11:06 (2) Answers

Send empty body in POST request in Retrofit

My api expects an empty json body ({ }) when making post requests. How do I set this up in Retrofit and Jackson? I tried passing null, and empty string, and "{}" but could not get this to work. @POST(my/url) Call<MyResponse> createPostRequest...
more »

2017-06-15 22:06 (1) Answers

Polymorphic Deserialization Issue with Jackson

I have the following classes that I want to deserialize a JSON string to using Jackson. PushNotificationMessage.java public class PushNotificationMessage { @JsonProperty("device_info") private DeviceInfo deviceInfo; private String conte...
more »

2017-06-14 18:06 (1) Answers

JSON parsing gives me NULL data

I am using Jackson library to try and parse my JSON file. My JSON is actually an ARRAY of JSON Objects: JSON ARRAY: [ { "Id" : "0", "name" : "John" }, { "Id" : "1", "name" : "Doe" } ] POJO CLASS: @JsonIgnoreProperties(ignoreUnknown =...
more »

2017-06-14 13:06 (2) Answers

Jackson - How to replace serialized Map

I need to serialize a graph to JSON containing List and Map. Each map instance contains a UUID field. The graph can contain more than one Map instance with the same UUID. Maps with the same UUID are considered identical. During Serialization, I wou...
more »

2017-06-13 20:06 (2) Answers