Skip to content
Advertisement

Tag: jackson-databind

@JsonIdentityInfo serialization of items

I’m trying to serialize relations using @JsonItentityInfo to avoid circular references. I’ve created a test to try test the result of the serialization, and I’ve found that jackson is not behaving as I expected. The serialization in not what I though it would be and, in fact, when I try to desarialize the serializated object, an exception is thrown. The

How to merge two jsonNodes in one

I have two variables of class User as follows: I want to create a JsonNode with the following structure: I have converted the objects to nodes, but I do not know how to merge them using Jackson. Or is there a more efficient way to create one json node structure with the two classes ? I am using Kotlin and

Swap Jackson custom serializer / deserializer during runtime

I have the following system: I am sending MediaType.APPLICATION_JSON_VALUEs from spring controllers to my client and vice versa. I also have an export/import feature of my to-be-serialized classes. The JSON File is created by using an ObjectMapper and utilizing the writeValueAsString and readValue methods. I am reading from and writing into the json file. Both of those serialization paths currently

JSON data mapping in Java with Jackson

I got stuck in mapping a json into my data structures “the easy way” using just Jackson decorators and I was wondering if there is a way to do this … The json that I try to read has the following structure: So basically every data entity has a “data_info” object (mapped in my code from below to DataTypeInfo) that

How do I globally enable “strict” handling of LocalDate values using Jackson?

Jackson Java 8 Date/time module issue jackson-modules-java8#212 mentions enabling “strict” handling via a global default: Currently LocalDateDeserializer automatically accepts non-standard format where time part also exists. While this is useful for some use cases, compatibility, it seems reasonable that if user forces “strict” handling (via @JsonFormat, or global default), that part would not be accepted. However, I am completely failing

Advertisement