Questions tagged [jackson-modules]
177 questions
3
votes
1 answer
When to use AALTO and when WoodStox for xml processing with Jackson
Reading this discussion
Aalto is by far fastest of the three, especially for parsing. It is commonly 50% - 100% faster than either Woodstox or SJSXP. One downside is that it does not handle DTDs (and thereby not external entities; it handles…

husayt
- 14,553
- 8
- 53
- 81
2
votes
0 answers
Cannot serialize/deserialize bidirectional references using Jackson JSON in Java?
I have intentionally created complex Java classes hierarchy, which also can occur on production in order to test Jackson JSON serialization and deserialization. Some annotations, like @Getter are Lombok ones.
DemoI.java
@JsonTypeInfo(
use =…

AnthonyGP
- 47
- 2
2
votes
3 answers
Java 8 LocalDateTime throwing exception for JsonString
I am testing my spring-boot code for Controller. for that I have written test like below
@RunWith(SpringRunner.class)
@WebMvcTest(AnimalController.class)
class AnimalControllerTest {
@Autowired
MockMvc mvc;
@MockBean
AnimalService…

LowCool
- 1,187
- 5
- 25
- 51
2
votes
0 answers
Jackson allow unquoted control chars disadvantages
Hi I use spring web and I need to send newline characters in my string by default I got 400 bad request.When I change allow-unquoted-control-chars parameter that time my request passed…

Bilgehan
- 1,135
- 1
- 14
- 41
2
votes
1 answer
Scala Enum Serialization Fails using Jackson when DefaultTyping is enabled
I see that the Jackson library is failing to serialize Scala enums, when the DefaultTyping is enabled with OBJECT_AND_NON_CONCRETE setting. Please note that the serialization works fine when I use JAVA_LANG_OBJECT setting.
I am seeing the below…

Varun
- 73
- 8
2
votes
1 answer
Custom Serializer and Jackson Schema
I have the following two classes:
public class MyChild
{
@JsonProperty
public int x;
}
public class MyTest
{
public void MyChild() {}
@JsonSerialize(using = MapValueSerializer.class)
private Map childs = new…

ZzetT
- 568
- 4
- 16
2
votes
2 answers
zalando problem-spring-web generates unwanted stack trace
I'm trying to implement RFC 7807 in my Spring Boot project using zalando problem-spring-web https://github.com/zalando/problem-spring-web
I've done the setup according to this guide…

Olivier Gérardin
- 1,113
- 14
- 27
2
votes
1 answer
How to JsonFormat long value with commas
I have a front-end I created that allows for a numeric value. Of course, the value the user should enter should strictly be a numeric value. That is no decimal, no commas, no $, no other values, and I can control this on the UI if I need…

tjholmes66
- 1,850
- 4
- 37
- 73
2
votes
1 answer
import statement for Jackson JavaTimeModule not recognized
I need to use the Jackson module JavaTimeModule.
I added the jar to my gradle build:
compile("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.4")
I successfully build the project and the jar is downloaded to my lib folder.
I refresh…

Gloria Santin
- 2,066
- 3
- 51
- 124
2
votes
1 answer
Configuring auto-serialization of Guava Multimap with Spring Boot when the `SpringBootApplication` impelments `WebMvcConfigurer`
I have the following SpringBootApplication:
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@SpringBootApplication
@Configuration
public class…

Neil
- 24,551
- 15
- 60
- 81
2
votes
0 answers
Jackson attribute mapping problem with Hibernate
I've researched a lot, but none of the solutions I tried to implement worked... I have the class below, which has many @JoinColumn @ManyToOne relations:
public class Consultas implements Serializable {
@Basic(optional = false)
@Column(name…

Lucas Lucian
- 21
- 2
2
votes
1 answer
Error in TypeReference in Kotlin Jackson Mapper
I've got the following data class
data class MyResponse(val header: String,
val body: T)
I want to write a generic Kotlin function that can deserialise json to various MyResponse or MyResponse
class…

Tin Ng
- 937
- 2
- 11
- 25
2
votes
0 answers
JacksonXml - How Unmarshal/Deserialize the last commented line in XML file
I have XML file where the last line is a commented text and contains unique ID XXX. The goal is a deserialize the comment value of a property.
Expected class…
AD
AE

Tioma
- 2,120
- 9
- 35
- 52
2
votes
1 answer
Jackson: Serialize null object as empty
I have huge json document and appropriate jaskson models that are mapped to that json. In some cases it is not possible to build the required json document with all object because some data does not exist.
for instance I have following models:
class…

fashuser
- 2,152
- 3
- 29
- 51
2
votes
1 answer
How do I create a Jackson Customizer for jackson-datatype-money in Spring Boot?
I am having an issue with this Spring Boot customizer for Jackson. Debugging it appears to be configured, but Jackson is not using the model during (de)serialization.
import…

Chuck C
- 423
- 1
- 4
- 12