Category "jackson"

How to get child JsonNode with a Jayway JsonPath

Here're my use case: Given a JsonNode (already parsed by Jackson), I'd like to provide a list of Jayway JsonPath to select sub JsonNodes that I'm interested. i.

Jackson deserialization of interface affects constituent member's deserializaton

I have an interface type with many implementation classes. I can serialize/deserialize this either by @JsonDeserialize(using = AlarmStateDeserializer.class) @Js

XmlMapper: read XML values without assigning a class for the created objects

I am trying to implement a multi language interface for my project and for this I want to load the data for the 3 languages from XML file. The problem is that w

Display Jackson ObjectMapper configuration

Before I invest energy building a utility to interrogate an ObjectMapper to output its configuration via methods like: objectMapper.getRegisteredModuleIds(); ob

java.lang.NoSuchFieldError: com/fasterxml/jackson/annotation/JsonInclude$Include.USE_DEFAULTS

I am using spring 5.3.7 and when I start my application, it returns the error below: Instantiation of bean failed; nested exception is org.springframework.beans

Parsing two objects into one

I've two objects objclient and objserver of the same type Object,(i.e. Dog, Cat..) when I receive objclient in my endpoint I need to replace its attributes with

How to override custom Jackson deserializer in child project?

In our company library (say lib-a) we have an interface: public interface MyInterface { ... } and its default implementation: public enum DefaultMyImpl imp

Optional fields in Java DTO with validation constraint

I've created a DTO with some properties with validation constraint (like all the properties must be present in JSON Object). Now, I want to make that DTO in a w

Why @JsonInclude(JsonInclude.Include.NON_EMPTY) is not working?

I am trying to set null values to database of empty values from JSON payload. This problem caused beacause I have unique constraints on social entity fields. I

Jackson serialization/deserialization problems when using @JsonTypeInfo. Can someone explain to me how this is working?

Say I have these classes public abstract class Shape {} public class Circle extends Shape{ private int r; ... } public class Main { public static

How to exclude a null value computed in JsonValue from JSON serialized by Jackson?

class Wrapper(private val value: String?) { @JsonValue fun asValue(): String? { return value } } val mapper = ObjectMapper()

Cannot deserialize XML object to data class using JacksonXml

I'm attempting to deserialize this xml string: val xml2 = """ <id>3</id> """.trimIndent() to this data class @JacksonXmlRootElement(localName = "

Java + JSON: list of anonymous objects (key + value) with different key names

Maybe it's simple, but I'm stuck... I have an app using Spring Boot and springframework.web.client.RestTemplate, so there's Jackson on backseat doing JSON job a

how to serialize String/null as json in quarkus?

quarkus serialize String as plain string, null as empty body(with http code 204) "foo" -> foo null -> (empty body) how to make it serialize String and nul

Spring doesn't load JavaTimeModule after Spring Update just load legacy one

I updated my project from spring boot 2.3.8 to 2.6.7 and I upgrade the jackson version to 2.13.2 I set the JavaTimeModule like this: @Bean @Primary public Obj

Error while parsing, when loading the data from snowflake having array datatype

I am trying to read data from snowflake and load it to other storage location. I am using snowflake jdbc driver 3.12.9 to read the data and jackson library(2.10

Serializing multiline string from JsonNode to YAML string adds double quotes and "\n"

I have a YAML string where one of the attributes looks like this: description: | this is my description //imagine there's a space after description th

SpringBoot: Enabling WRAP_ROOT_VALUE feature using custom Jackson2ObjectMapperBuilder shuts off Swagger3

I've read many articles/threads and what not about how to enable Jackson's WRAP_ROOT_VALUE feature in SpringBoot (v2.2.2RELEASE) and none of them really work, u

Getting conversion issue after migrating jackson-databind from 2.11.4 to 2.12.13.2

We have recently migrated jackson-databind from 3.11.4 to 3.12.13.2 version and springframework from 5.2.19.RELEASE to 5.2.22.RELEASE. after the migration we s

LinkageError: loading constraint violation when overriding method javax/xml/stream/XMLInputFactory.createXMLEventReader

I'm upgrading an application that's hosted on WebSphere 9 running IBM JDK 8 from Spring 4.0.3 to 5.3.18. While doing so I updated the project's Jackson, Woodsto