Questions tagged [jackson-modules]
177 questions
1
vote
0 answers
How to convert LocalDate value in Map with Jackson serialization/deserialization?
I have a class which looks like below:
class A {
Map mapLocalDate;
Map simpleMap;
String name;
}
This class should be converted to Map < String, Object >, where the key is the attribute name and the value is…

Speise
- 789
- 1
- 12
- 28
1
vote
1 answer
Jackson TreeModel vs Databinding
I am trying to think of scenario to use Jackson TreeModel and Databinding API (Object mapper). When you would chose one again the another ?

Leo Prince
- 940
- 2
- 14
- 33
1
vote
0 answers
Programmatic way of @JsonSubTypes and @JsonTypeInfo
I have the following class and it works as expected:
class TestClass
{
@Inject
public TestClass(
String type,
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", include = JsonTypeInfo.As.EXTERNAL_PROPERTY)
…

burak emre
- 1,501
- 4
- 22
- 46
1
vote
1 answer
Coverting Java class to Json schema - FasterXML / jackson-module-jsonSchema
I am playing with some Spring Boot code to convert a java class to a Json schema and am getting strange behavior just by addin the dependency to the POM file as in
com.fasterxml.jackson.module
…

Basixp
- 115
- 6
1
vote
1 answer
Jackson JSON serialization inclusion to ignore only null fields and empty collections
We have recently moved from Jackson json 2.8.2 to 2.9.4 and we're seeing major changes in the behavior. We are using JDK 1.8.
Earlier we set the Serialization inclusion as NON_DEFAULT at object mapper level and all wasworking fine.
Now after changed…

Ram
- 41
- 2
1
vote
0 answers
How to Convert a Jackson JavaTimeModule to Java Instant
in Jackson JavaTimeModule java time objects are converted to timestamps in the for of 1421261297.356000000, where the integer part is the number of seconds and the decimal part the number of nanoseconds of an Instant.
I want to convert this back to…

Michel Feinstein
- 13,416
- 16
- 91
- 173
1
vote
2 answers
Jackson Provider Multiple ObjectMapper for same Class
I want to serialize the same Category class with two mapper in different resources method.
I have written two classes that serialized Category in two different ways
CategorySerialized and CategoryTreeSerialized
public class MyJacksonJsonProvider…

Pako
- 339
- 2
- 8
- 20
1
vote
2 answers
jackson make two json attributes of one java attribute
I have a little bit of a comfort problem using jackson in a rest api.
I am using jackson to serialize object that have attributes of any type in java.time like:
public class DomainObject{
public LocalDateTime start;
}
I can use jackson to…

Mr.H.
- 965
- 1
- 10
- 18
1
vote
1 answer
java.lang.NoClassDefFoundError: com/fasterxml/jackson/annotation/JsonInclude$Value
I am running into this error while trying to compile my maven project during the test execution. From what I understood after insane amount of googling is that this is because of some conflicting version of jackson-core thats in the classpath.
Here…

user_mda
- 18,148
- 27
- 82
- 145
1
vote
1 answer
Spring MVC, MessageConverters, Code Configuration Ignored
I'm using a mix of xml and codebased configuration. One part of my code configuration was ignored. This one:
@Configuration
@EnableWebMvc
public class RestMvcConfig extends WebMvcConfigurerAdapter {
@Override
public void…

Wrench
- 4,070
- 4
- 34
- 46
1
vote
1 answer
How do i add a Jackson custom deserialiser of a list to a module?
I have a custom deserializer
class MyListDeserialiser extends JsonDeserializer
- >{
@Override
public List< MyObject > deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
....
return myListOfObjects;…

d4c0d312
- 748
- 8
- 24
1
vote
0 answers
What is the difference between an ArrayItems vs SingleItems in Jackson JsonSchema module?
In the documentation, ArrayItems is described as
When this attribute value is an array of jsonSchemas and the instance value is an array, each position in the instance array MUST conform to the jsonSchema in the corresponding position for this…

THIS USER NEEDS HELP
- 3,136
- 4
- 30
- 55
1
vote
1 answer
Extend enum and use it in overridden method in java
I am facing an issue regarding extending a method from abstract which returns enum.
Below abstract class from com.fasterxml.jackson library which I need to extend.
public abstract class JsonSchema
{
public abstract JsonFormatTypes…

Abhij
- 1,222
- 4
- 19
- 37
1
vote
2 answers
JsonMappingException: No suitable constructor found for type [simple type, class car.Car$Parts]
I'm trying to deserialize this XML into a Parts object:
gearbox
1990
wheel
2000
…

Hooli
- 1,135
- 3
- 19
- 46
1
vote
2 answers
Jackson Afterburner module is failing inside Apache Karaf 3.0.5
I have a simple Hello World type Karaf Bundle running inside Apache ServiceMix 6.1.0 using Jackson's Afterburner Module. The activator code looks like below:-
public class HelloWorldActivator implements BundleActivator {
@Override
…

tuk
- 5,941
- 14
- 79
- 162