need some help with jackson2 and springMvc. Issue: when adding MappingJackson2HttpMessageConverter jsons fail to parse (previously they did parse) with error below. I have following @Controller method in code: And it have been working just fine until I’ve decided to add MappingJackson2HttpMessageConverter() into converters. Like this: but after I do so, my requests stop to work with the following error
Tag: jackson
Jackson deserialization to concrete polymorphic class
I have following Jackson annotated classes (Kotlin) I try to deserialize JSON that does not contain type property but I provide concrete class so it should not matter I get Missing type id when trying to resolve subtype of … anyway. Is there a way how to tell Jackson to use the type provided in the deserialization and not to
Stack overflow error for hibernate one-to-one mapping with Spring Data JPA
My problem is similar to this one https://discourse.hibernate.org/t/hibernate-throws-org-hibernate-id-identifiergenerationexception-attempted-to-assign-id-from-null-one-to-one-property/1777 but I am getting a different exception after applying the answer from this thread. My entities: Controller with corresponding Spring Data Repository: With this payload: I am getting an endless nested response with proper fields(distributor -> location -> distributor -> location ..), which ends with SO Error: I can’t fathom why does
How to deserialise anonymous array of mixed types with Jackson
In my Java program, I am trying to parse data that I get from Strava.com’s API. One of the JSON payloads, I receive from there looks as follows: Basically, four of these entries (altitude, velocity_smooth, distance and time) have the same structure (their data field is an array of doubles (or ints that can be parsed as doubles)), but the
Micronaut HTTP Client – Deserialize generic type – For API Testing
For API testing I have to parse the response of a request using io.micronaut.http.client.HttpClient I prefer to use the format given below. But It is not working. I am getting type cast error while trying to fetch User from response Currently I am using ObjectMapper (Jackson) like given below, Is there any way to use TypeReference directly with HttpClient retrieve
JSON parse error: Cannot deserialize value of type `java.time.LocalDateTime` from String
I am sending request to external service which has updatedDate property When I receive the response in my DTO I am trying to format the LocalDateTime property like this But I get error in Postman Answer There are milliseconds in the input string, so your format should be “yyyy-MM-dd’T’HH:mm:ss.SSS” Update: If the millisecond part consists of 1, 2, 3 digits
Geting list of protobuf message objects from the SpringBoot
I want to get a list of protobuf message objects from the Spring boot app. I did manage to get a single protobuf message object from the app but getting a list of them throws exception. My code (simplified). tl;dr create Spring boot app generate class from proto file try return List of generated class objects (RESTful) My code (simplified).
REST API for updating informations with empty or null values
I have a general question about how best to build an API that can modify records in a database. Suppose we have a table with 10 columns and we can query these 10 columns using REST (GET). The JSON response will contain all 10 fields. This is easy and works without problems. The next step is that someone wants to
Convert from object to AWS Kinesis -> Java Cannot deserialize instance of `java.util.Date` out of VALUE_NUMBER_FLOAT token
I am working on a AWS lambda function in order to get dynamically a SNS Event or a Kinesis Event, to do so, in my lambda function I am getting an Object as parameter: Then, I am using Jackson in order to convert it to SNS or Kinesis dynamically: The problem is that, when I’m using the convertToKinesisEvent function I
Parse array JSON Schema with Jackson
I have a JSON Schema defined : It’ll always be a schema which contains firstly items and then it’ll contain properties. In properties can be more arrays or objects found so I want to do that recursively. What i’m trying to achieve is a Map<String, Object> which directly represents the schema. Where I’m getting stuck is the recursive call where