Questions tagged [jackson-modules]

177 questions
3
votes
2 answers

How to register a Jackson Module in Quarkus?

I'd like to register the Kotlin-Module with Jackson in a Quarkus application so Jackson can deserialize JSON into data classes without needing a NoArgsConstructor. What is the best way to do this? Update after comment The application is a REST…
Christoph Grimmer
  • 4,210
  • 4
  • 40
  • 64
3
votes
1 answer

Trying to speed up spring-web endpoint json serialization (afterburner)

I am using Spring Boot 1.5.8 and spring-web 4.3.12. I have noticed that, when I make a request for data from one of our REST endpoints, more time is spent on data serialization than the rest of the operation. I have been looking into strategies to…
Steve Storck
  • 793
  • 6
  • 25
3
votes
1 answer

What is the easiest way to deserialize human readable time duration in Java?

I need to have configurable timeout for a project, which reads different configs from YAML file. I noticed that java.time.Duration has method parse which is used by Jackson to deserialize duration strings. The problem is that it uses ISO-8601…
DaTval
  • 316
  • 1
  • 6
  • 14
3
votes
1 answer

Jackson Deserialize List of Objects into a Map

I have my own custom deserializer @Override public Map> deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException { JsonNode carsNode = p.getCodec().readTree(p); …
user3100209
  • 357
  • 1
  • 4
  • 17
3
votes
2 answers

Client Resteasy with LocalDateTime

I trying to use the Resteasy CLIENT to call one REST service In my Service I create with springboot and return one LocalDateTime propert If I use this depencency com.fasterxml.jackson.datatype
Fabio Ebner
  • 2,613
  • 16
  • 50
  • 77
3
votes
0 answers

Register deserializer for a wrapped List of type

I have JSON that is like this: { "apps": [ { "id": "1", ... }, { "id": "2", ... } ] } And for example say the Application class looks like this data class Application( val id: String ) I want to…
mkobit
  • 43,979
  • 12
  • 156
  • 150
3
votes
1 answer

Jackson + Spring web unable to deserialize unquoted string after modifying message-converters

I have a spring controller method which takes a String as the entirety of the RequestBody like so: @RequestMapping(method=RequestMethod.POST) public @ResponseBody DTO method(@PathVariable("userId") long userId, @RequestBody String page) { …
3
votes
2 answers

How do I avoid content fields in Joda objects?

I'm using Joda objects (DateTime and DateTimeZone) in a document and whenever I access it via the REST interface I get entries with fields like this lastAggregationDate: { content: "2016-07-12T17:58:43.643Z" } instead of lastAggregationDate:…
3
votes
1 answer

JsonGenerationException: CSV generator does not support Object values for properties

I'm trying to serialize Foo into a String. It seems like a pretty simple task but for some reason DateTime seems to break it. Test.java import com.fasterxml.jackson.dataformat.csv.CsvMapper; import…
Hooli
  • 1,135
  • 3
  • 19
  • 46
3
votes
1 answer

how do i convert list of jsonNodes to single jsonNode

I am using Jackson library. I have number of java objects which are nothing but the wrapper for jsonNode. So want to convert these list of jsonNodes into single jsonNode. how can i do that. i tried this public JsonNode converter(List
Kaustubh_Kharche
  • 725
  • 3
  • 13
  • 34
3
votes
2 answers

Reading skipped children in Jackson Custom Deserializer

I have a deserializer for a specific class which needs some ordering while reading fields. Let's say I have two fields in my class (field1 and field2) and in order to read field2, it first needs field1. For example for the following json data it…
Boyolame
  • 329
  • 2
  • 13
3
votes
2 answers

Jackson custom deserializer module to abstract class

I have a big set of classes (like more that 100) and they are all extend from some abstract class, let's call it ParentClass. Let's call child classes ChildA,ChildB, etc. How can I register custom deserializer for all children and get class type…
Tom
  • 363
  • 7
  • 17
3
votes
1 answer

Jackson and the Guava datatype module: Ignore missing fields, but serialize explicit nulls

I am storing test data for a RESTful endpoint in json. I will be deserializing the test data into POJOs to pass into REST Assured for testing. Underneath the hood, REST Assured serializes the POJOs using Jackson when constructing request objects. I…
Selena
  • 2,208
  • 8
  • 29
  • 49
3
votes
1 answer

Scala Class[_$1] where type _$1

Right now trying to instantiate a new JSONConverter to register Jackson's Scala module. private def getConverter(implicit m: ClassTag[T]) = { new JSONConverter[T](classTag[T].runtimeClass, bucketName) …
crockpotveggies
  • 12,682
  • 12
  • 70
  • 140
3
votes
1 answer

Ignore fields only in json but not xml with jackson-dataformat-xml

Using Jackson with the jackson-dataformat-xml module, I am able to serialize POJO to both JSON and XML. There are a few fields (xml attributes) in my object that should only be serialized to XML but not JSON. If I apply the @JsonIgnore annotation,…
ltfishie
  • 2,917
  • 6
  • 41
  • 68