Questions tagged [jackson-databind]

Use this tag for questions related to jackson-databind library providing the data-binding functionality and tree-model for Jackson.

Jackson-databind is a library providing the general-purpose data-binding functionality and tree-model for Jackson Data Processor.

See github project for brief introductionary tutorials, in recommended order of reading. More comprehensive documentation can be found from Jackson-docs repository; as well as from Wiki of this project.

1230 questions
-2
votes
1 answer

Based on dynamic JSON input request need to set the parameters value in POJO class

I can pass any dynamic JSON as the request body from Postman. For Example- JSON 1 { "controlNumber": "12345", "AssociateId": "1A23242aew", "EmployeeCode": "ABC" } JSON 2 { "controlNumber": "12345", "AssociateId":…
man123
  • 72
  • 5
-2
votes
1 answer

Conversion from JSON to POJO

"testing":{"infixSuggester":{ "Sample":{ "numFound":10, "suggestions":[{ "term":"test", "weight":0, "payload":""}, { "term":", "weight":0, …
Vamsi
  • 25
  • 1
  • 5
-2
votes
1 answer

Is there an automatic way to deserialize a json payload into a generic JsonObject without a POJO?

I have a rest API that consumes a simple JSON object, ie: { "prop": "value" } @Consumes(MediaType.APPLICATION_JSON) public Response apiName(@HeaderParam("field1") String field1, JsonElement payload){ ... } I don't want to create a POJO for this…
Amos
  • 415
  • 1
  • 4
  • 10
-2
votes
1 answer

How to convert JSON object to a Pair object in JAVA

From the API client, I am sending { "scheduledDateTime": "27-12-2020 08:55:46", "subscriptionClosedBy": "30-12-2020 08:55:46", "presenter":{"first":"Jone Doe","second":"Senior Tech Lead"} } JSON object to my following API…
Udara Seneviratne
  • 2,303
  • 1
  • 33
  • 49
-2
votes
1 answer

How to deserialize complex JSON to java object

I need to deserialize JSON to java class. I have JSON like the following: { "data": { "text": "John" }, "fields":[ { "id": "testId", "name": "fieldName", "options": { "color": "#000000", "required":…
John
  • 1,375
  • 4
  • 17
  • 40
-2
votes
1 answer

Read JSON property in Java

I am getting below output when I am calling postAPI from java. I want to store access_token in a variable but I am not able to do it. in javascript I can do it easily but in Java it is becoming difficult for me. Can anybody help me on the same. { …
Shruti sharma
  • 199
  • 6
  • 21
  • 67
-2
votes
1 answer

Jackson's json parsing

I'm a graduate student that is trying to learn how to parse json to objects using Jackson. I'm currently trying to parse this { "EmptyMessage":"", "EmptyMessageType":0, "Result":[ { "HasEducationPlan":false, …
-2
votes
1 answer

Spring boot: Cannot serialize Int as Float

I'm using a ready Jackson-databind serializer to return an integer field as float: @XmlElement(name = "toPick") @Column(name = "to_pick") @JsonSerialize(using = FloatSerializer.class) private Integer toPick; But I get this message during…
Arnie Schwarzvogel
  • 955
  • 1
  • 13
  • 25
-2
votes
1 answer

Java - Deserialize nested json to object

I have problems to deserialize some nested Json. The json : JSON LINK HERE To deserialize : And the two classes : I'm getting this Exception : com.fasterxml.jackson.databind.JsonMappingException: Unrecognized Type: [null] Any suggestions?
Tirvax
  • 35
  • 1
  • 10
-3
votes
1 answer

How to serialize json to Map?

I need to serialize json to Map. My son looks like the following: { items: [{ "name": "Test1", "value": { "id": 1, "count": 5 } }] } and I have following classes: public class Value { public int id; …
John
  • 1,375
  • 4
  • 17
  • 40
-3
votes
1 answer

Deserializing nested objects in Jackson

This should be straight forward based on the docs and examples I've seen around but I haven't managed to get this working. I apologize if this has been posted elsewhere but I have not been able to find the same issue even though it relates to…
-3
votes
2 answers

How can I break JSON in simplest form using Jackson

{ "first":"element", "second":"Integral", "isThird":false, "fourth":{ "ONE":[ { "100":"Cars" }, { "200":"Truck" } ], "TWO":[ { …
Tatkal
  • 568
  • 4
  • 9
  • 29
-3
votes
1 answer

Scala Map Option

I have a map in scala like this. val someData = Some(Map(genderKey -> gender,agekey -> age)) How to get the output as: val key= genderkey val value= gender val key2 = agekey (Dynamic variable name) val value2= age (Dynamic variable name)
JSF Learner
  • 183
  • 2
  • 7
  • 15
-4
votes
1 answer

Jackson deserialize an object that implements an interface and ignore the interface properties

I have an annotated class that implements an interface with a read-only property named .id() that is generic so I can pull different types of ids in other parts of the program. This entire interface should be ignored by Jackson. But instead I get…
user177800
1 2 3
81
82