Category "jackson"

How can I create immutable DTOs using Jackson but without annotions?

Jackson can deserialize JSON data into immutable objects. But by default the constructor or static factory method parameters have to be specified either using @

How to deserialise a field and tell the difference between the value being null or absent?

When I am deserialising into my class, for some fields, I would like to be able to tell the difference between the value being absent, or null. For example, {"i

Scala Jackson deserialization failing with "non-static inner classes" error version Jackson2.10

I am trying to upgrade from Jackson-2.5 to 2.10 Below deserialization code was working for me, before but post upgrade the solution is failing with following er

Creating a JAVA Object from XML using Jackson XML for multiple elements with same TAG

I have the following XML Structure which I am using to create a Java Object. <TABLE NAME="AB" ID="10" CODE="ABC123" RANK="102" YEAR="2022" TIMESTAMP="

JsonProperty in java

I found this question in other questions, but I think they are too old and they are not working anymore. I'm consuming an external service that returns a JSON a

What should be @JsonFormat(pattern="") in Spring-boot for given example

Using Spring-boot RESTful service,in that receiving JSON file which contain DateTime in following format "2017-08-16T16:08:25.000Z" and JsonFormat tries are e.g

CustomDeserializer has no default (no arg) constructor

I am consuming a REST Api with RestTemplate. The response I'm getting from the API has lots of nested objects. Here's a little snippet as an example: "formular

Restructure JSON before deserializing with Jackson

We have a service which currently consumes JSON. We want to slightly restructure this JSON (move one property one level up) but also implement graceful migratio

Sending protobuf as JSON in spring-boot

I´m using protobufs with this concrete definition. message Hash { string category = 1; repeated KVPair content = 2; } message KVPair { strin

Jackson deserializer for generic type

I need to write a custom deserializer for a class with generics. I couldn't find a way to do this, however I cannot imagine I'm the only one with this problem.

Jackson version conflict in groovy

When I run the code below using groovy 3.0.2 I get an error because groovy/lib dir already has some older version of jackson and for some reason some of them ge

How to configure jackson with spring globally?

To serialize deserialize object I am useing Jackson as flow @JsonSerialize(using = LocalDateSerializer.class) @JsonDeserialize(using = LocalDateDeserializer.cl

java.lang.ClassNotFoundException: com.fasterxml.jackson.annotation.JsonInclude$Value

I am trying to convert my json string to java object and I am getting error Exception in thread "main" java.lang.NoClassDefFoundError: com/fasterxml/jackson/ann

Custom property keywords in JSON Schema using Jackson annotations

I would like to create custom property keywords that would be preset in the JSON schema generated using Jackson. This would be something similar to what JsonPro

Why does Jackson 2 not recognize the first capital letter if the leading camel case word is only a single letter long?

I'm using Spring 4 MVC with Jackson 2 for my service. For one of the operations I have a request object that has an attribute where the leading camel case word

Need Jackson serializer for Double and need to specify precision at runtime

There are many posts about creating Jackson serializers for numbers, currency, etc. For engineering applications, there is often a need to set the precision on

Check if JSON is valid in JAVA using Jackson

I have a JSON string which I am storing it in DB as a string. In front-end, I am rendering this JSON as object. I am using: JSON.parse(string); Uncaught S

How to use Jackson JsonSubTypes annotation in Kotlin

I'm trying to convert some Java code that uses Jackson's @JsonSubTypes annotation to manage polymorphism. Here is the working Java code: @JsonTypeInfo( us

Deserializing YAML with root name prefix using Jackson

I would like to deserialize a YAML file into a Java object using Jackson and jackson-dataformat-yaml. The YAML is company: product: settings: proper

Jackson/Kafka LocalDateTime serialization not working properly

We have a very strange/intermittent issue with kafka and jackson. We have a dto defined which has 4 date field startdate, enddate and a embedded metatdata class