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
-1
votes
2 answers

How to use Jackson for parse object follow json type?

I have two Json objects like : Object 1 { "value": { "data": [ "John", "Justin", "Tom" ], "isGraduated": false } } Object 2 { "value": { "data": { …
Blind
  • 99
  • 1
  • 11
-1
votes
2 answers

LocalDate serialization does not work with spring boot - (@jsonformat dos not work )

I am trying to parse JSON as local date, I tried multiple options including @jsonFormat but I am still getting the below exception - (I am using spring boot rest controller for accepting this request) public class Student { private long…
dileep
  • 21
  • 2
-1
votes
1 answer

Using own jackson versions in Flink causes VerifyError

I'm using Apache Flink (v1.11) with Scala and added an own DeserializationSchema for Kafka connector. Therefore i would like to use my own packages and versions of jackson (v2.12.0). But i got the following error: Exception in thread "main"…
-1
votes
1 answer

Convert Map to POJO using Jackson / Gson API

I'm using a third-party API returns data as Map> which is in JSON format, where key is a String and is same as class variable and Set contains related value, which will be String and only one value is expected even though it is a…
Tech Sawy
  • 91
  • 7
-1
votes
1 answer

How to solve error "Exception in thread "main" java.lang.NoClassDefFoundError: com/fasterxml/jackson/annotation/JsonView"

I am trying to evaluate a json string using the jackson library ObjectMapper. I have added the jackson-annotaion ,jackson-databind and jackson-core dependencies with the same version in the pom.xml file too.But code gives following error.I checked…
-1
votes
1 answer

Return ISO-8601 dates with custom ObjectMapper in Spring Boot 2

I want my LocalDateTimes to be returned as ISO-8601 strings (e.g. "2020-10-12T10:57:15Z") from my Spring REST Controllers. This has worked previously, but now that I'm using a custom Jackson2 ObjectMapper these dates are instead being returned as…
darksmurf
  • 3,747
  • 6
  • 22
  • 38
-1
votes
1 answer

Need help parsing this JSON

I have this JSON file in following format. The first object is customer information, the second is order information, followed by n number of objects for details of each part ordered. I need to convert this to Java POJOs. This is what JSON looks…
J.J
  • 633
  • 1
  • 6
  • 14
-1
votes
1 answer

do not allow {} as request body

I have the following post method handler: @PostMapping("/endpoint") public int myEndpoint(@RequestBody MyBody body) { return body.foo; } Which accepts the following request body: class MyBody { private int foo; public MyBody() {} …
Noam
  • 333
  • 1
  • 18
-1
votes
1 answer

Set JSON Data to Java Model and Iterate Over Jsp

i am new to working with Api in java. Can Any One Help To Implement This in Better Way. I Have A JSON OBJECT. like.. { "firstState": { "district": { "first": { "polulation": 100000, "lastupdatedtime": "", "delta":…
PradeepBhati
  • 63
  • 1
  • 3
  • 11
-1
votes
2 answers

How to get a single key-value from JSON using ObjectMapper in java

I have a json file called file.json which has a contents as following. [ { "symbol": "AAPL", "quantity": 100, "tradeType": "BUY", "purchaseDate": "2019-01-02" }, { "symbol": "MSFT", "quantity": 10, "tradeType":…
-1
votes
1 answer

Dropwizard ObjectMapper not honouring enable(MapperFeature.ACCEPT_CASE_INSENSITIVE_ENUMS)

I want to be able for jackson to parse case insensitive enums. For e.g public enum OperType { SUM PRODUCT } i want to accept both "SUM" and "sum" in the POST request. I am getting hold of objectMapper in Application::run and enabling the…
hrrray
  • 9
  • 5
-1
votes
1 answer

Single instance of Jackson's ObjectMapper is not working

I am using single instance of jackson's ObjectMapper with configuration Deserialization Feature fail on unknown properties is false in my Application. It's not working sometimes getting error Conflicting/ambiguous property name definitions (implicit…
-1
votes
1 answer

Safely Ignore JSON Property that Contains All Other Objects

I am working with Spring Boot, and am parsing a JSON file with Jackson. The file looks like this { "grouping": [ { "obj1": "value1", "obj2": "value2", "obj3": "value3", "obj4": "value4" …
Southpaw
  • 43
  • 5
-2
votes
1 answer

Convert json to Class

I have a class with a data member defined with a @SerializedName annotation (see below). public static final String SERIALIZED_NAME_ENGINE_ID = "engine_id"; @SerializedName(SERIALIZED_NAME_ENGINE_ID) private String engineId; I want to map JSON…
-2
votes
1 answer

How to map JSON object with java Pojo class ignoring parent class spring boot?

I want to map below Json object with Java Pojo class ignoring parent class AuthToken. { "AuthToken" : { "id" : "1", "token" : "abcde1234xyz", "extendSession" : null } } Pojo Class public class TokenAccessResponseDTO { …
Bhavesh Shah
  • 127
  • 2
  • 14
1 2 3
81
82