Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
59 views

I am trying to map a generic Java object client RequestDto to a complex Avro record that includes unions. The Situation: I have been given an Avro schema, which means I can't/shouldn't make any ...
codingTooth's user avatar
0 votes
1 answer
81 views

Let's say you have an annotation configured on a per field basis: import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import ...
Nicholas DiPiazza's user avatar
0 votes
0 answers
52 views

ObjectMapper mapper = new ObjectMapper() .configure(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY, true) .configure(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS, true); Map<String,...
Dasmowenator's user avatar
  • 5,528
-1 votes
1 answer
168 views

I am trying to build database - and i want to get data that i need from API which have an authentication token - im using Java, Spring, MySql DB I've created simple example of what i want to achieve - ...
JuniorD's user avatar
0 votes
2 answers
168 views

I've a model class which I can't change its source, it is annotated with public class Announce { @JsonProperty(value = "id", access = JsonProperty.Access.READ_ONLY) @Id @...
Rafael Lima's user avatar
  • 3,585
0 votes
1 answer
165 views

We are migrating the Spring Boot application (mixture of Spring Data Rest with plain vanilla mvc) from version 2.5.12 to 3.4.0. The application heavily depends on the ObjectMapper configured with ...
AlexanderB's user avatar
4 votes
1 answer
4k views

I've upgraded Jackson from 2.16.1 to 2.18.2 in my build.gradle: plugins { id 'java' id 'jacoco' id 'com.github.johnrengelman.shadow' version '8.1.1' id "org.sonarqube" ...
Sergey Tsypanov's user avatar
0 votes
0 answers
107 views

I'm trying to parse a JSON string into a Map using ObjectMapper. To achieve this, I used this simple code below. ObjectMapper objectMapper = new ObjectMapper(); Map value = objectMapper.readValue((...
marcus's user avatar
  • 11
2 votes
1 answer
63 views

Jackson's TypeReference allows reifying the generic type parameters of a type via subclassing. Example: final var typeRef = new TypeReference<List<MyType<MyArg>>>() {}; final List<...
knittl's user avatar
  • 269k
0 votes
1 answer
105 views

Given the following SampleTestClass where I try to parse JSON to Java: class EmptyListDeserializerTest { final ObjectMapper objectMapper = new ObjectMapper(); { objectMapper.configOverride(List....
DavidO's user avatar
  • 69
0 votes
2 answers
11k views

I have an issue while trying to parse a string value using object mapper. Below is my code, @Data @NoArgsConstructor @AllArgsConstructor public class Payload { private String id; private ...
WebNoob's user avatar
  • 259
-1 votes
1 answer
73 views

I'm looking for some help. I have a requirement to convert the input json to a java object. Input JSON is something like this { "code" : "some code", "type" : "...
Srikanth's user avatar
  • 594
0 votes
2 answers
253 views

I'm having trouble integrating Spring with Jackson. I have a POJO which has some Instant fields with a custom date format: public class C{ @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = &...
Rafael Lima's user avatar
  • 3,585
0 votes
1 answer
622 views

In my Spring Boot service, I'm using RestClient to perform REST calls. I want to ignore null values in request bodies so I set up spring: jackson: default-property-inclusion: "non_null"...
David Kubecka's user avatar
1 vote
1 answer
91 views

{ "data":{ "id":"550e8400-e29b-41d4-a716-446655440000", "timestamp":"2023-05-01T16:34:16.993007076Z", "isProcessed":...
J.Doe's user avatar
  • 194
1 vote
0 answers
73 views

I have a java openapi generated client which I use to retrieve some image from a remote server (this process runs fine against a browser, postman, etc.). I am able to configure the objectMapper of the ...
António's user avatar
1 vote
1 answer
568 views

I have the following minimal code: final var xmlString = "<parent><child>data</child></parent>"; final var xmlMapper = XmlMapper.xmlBuilder() .enable(...
Nikolas's user avatar
  • 45k
4 votes
1 answer
156 views

You can tell how to configure ObjectMapper to automatically handle LocalDateTime class covered here: serialize/deserialize java 8 java.time with Jackson JSON mapper But when I try to use POJOs with ...
Nicholas DiPiazza's user avatar
1 vote
1 answer
195 views

There are two ways to handle JSON in Redis: Use Jackson ObjectMapper to serialize the data before storing it in Redis, and then deserialize it when retrieving the data. Use the RedisJSON module to ...
Kevin's user avatar
  • 810
0 votes
1 answer
112 views

YAML file example --- # Author : John Doe # Updated Date: 6/21/2024 4:23:22 PM # Status: Deployed. name: "stack overflow" version: 5 While parsing the yaml file, How to ignore the comment ...
Krishnam's user avatar
  • 869
2 votes
1 answer
191 views

For the serialization of Java object instances I use the Jackson Library and have built several JsonSerializers, which should individually check Player.class, Vehicle.class and Building.class and ...
Jonas's user avatar
  • 65
1 vote
0 answers
146 views

I have the following class: import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import lombok.Getter; import lombok.Setter; import ...
Lizzie's user avatar
  • 351
0 votes
1 answer
74 views

I am using Spring XML App (not Spring Boot and can't move), when I used below code I am getting details value for Date, what I want to just print yyyy-MM-dd format. import com.fasterxml.jackson.core....
PAA's user avatar
  • 12.2k
0 votes
1 answer
199 views

Below is my response POJO Class @Getter @Setter @Builder @AllArgsConstructor @NoArgsConstructor public class ProductResponse { boolean required; ProductModel model; } Below is my code where I'...
Sweta Sharma's user avatar
  • 2,844
3 votes
1 answer
157 views

I need a handy way to censore DTO fields/secrets when converting them into a json string (for logging). Im using objectmapper and I heard about @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) ...
Baksa Zoltán's user avatar
0 votes
2 answers
163 views

Hey all I am trying to figure out how to go about updating a part of my json. So far I have not found anywhere that shows me how to do this. For an example, this is what I am needing to update: { &...
StealthRT's user avatar
  • 10.6k
1 vote
1 answer
503 views

I am using RestEasy client POST request as in the following interface: @POST @Path("/somePath") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response ...
idan's user avatar
  • 11
1 vote
0 answers
18 views

I use springboot2.7.18 to get a JSON This is my objectMapper config file. @Configuration public class JackJsonConfig { @Value("${spring.jackson.local-date-time-format}") String ...
mtxst's user avatar
  • 11
0 votes
1 answer
48 views

I have a lib which i cannot change. This lib has api method which returns json like this {OrderStatus=PartiallyFilledCanceled} and also this lib has a enum @AllArgsConstructor public enum OrderStatus {...
Nicolazz92's user avatar
0 votes
1 answer
66 views

Below is my SMS class public class SMS implements Notification { private static final Logger LOG = LogManager.getLogger(SMS.class); private static final Properties PROP = PropertyReader....
Kavishka Rajapakshe's user avatar
-1 votes
1 answer
236 views

I have my own object when there is no value it is coming as "NULL" in a string from downstream and it is failing while converting to java object in ObjectMapper class Test private String ...
Shuaib Shaikh's user avatar
0 votes
2 answers
429 views

I have the Qurakus app with REST API @Path("/hello") public class ExampleResource { @GET @Consumes(MediaType.APPLICATION_JSON) public ObjectNode hello() throws ...
Andrey Kirson's user avatar
0 votes
1 answer
240 views

import com.fasterxml.jackson.databind.ObjectMapper import com.fasterxml.jackson.databind.jsontype.BasicPolymorphicTypeValidator import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule import com....
MangKyu's user avatar
  • 51
-1 votes
1 answer
80 views

I am calling another api and get the below json response { "metadata": {}, "data": { "productId": 102001, "productName": "P101"...
user3919727's user avatar
1 vote
0 answers
203 views

I am trying to form an Xml from a json. I have Object templates for json and using ObjectMapper to map. While i transfrom, there are some aspects that i need to follow for required rules. If an array ...
Morphelia's user avatar
-1 votes
1 answer
142 views

I have a simple check with ObjectMapper.writeValueAsString for a test to verify that no input have been changed without a developer having noticed it. It works fine but the issue is that the length ...
David S's user avatar
  • 307
1 vote
1 answer
106 views

When converting a Jackson JsonNode to a Java collection? See question/answer below: https://stackoverflow.com/a/39237947/15435022 ObjectMapper mapper = new ObjectMapper(); // singleton in the project ...
mattsmith5's user avatar
  • 1,327
0 votes
1 answer
3k views

When use spring boot, from time to time I need to log my objects like UserInfo, Person and another to log in json format If I log just to put my object, logs looks like User@3242 (with hash code) So I ...
Roberto's user avatar
  • 1,435
0 votes
0 answers
216 views

I have Big JSON payload and I am trying parse this Json into Target class. in the target class there is one filed which is String type. But JSON payload will have Object structure. When I parse this ...
Seegel's user avatar
  • 61
1 vote
0 answers
57 views

Affects: \3.1.5 I am using custom configuration for an ObjectMapper like that: @Autowired private ObjectMapper objectMapper; @Override public void extendMessageConverters (List<...
Nahuel Scuri's user avatar
1 vote
1 answer
2k views

I am encountering an issue while consuming an API that returns a JSON string. When attempting to convert the JSON string response from the API to a Map<String, Object>, it throws an error. ...
Abhay Valappil's user avatar
-2 votes
1 answer
2k views

My unit test is getting the error "this.objectMapper" is null"... I have marked the objectMapper with @Autowired annotation. java.lang.NullPointerException: Cannot invoke "com....
Art yudi's user avatar
1 vote
0 answers
67 views

I would like to ask if there is any option to turn on default typing for main, "containter" class only? I have a simple, testing class "Document" which is my container type for ...
F1zz4's user avatar
  • 23
0 votes
1 answer
285 views

I am working on a project which has a custom JSON Serializer defined public class JsonCustomSerializer extends JsonSerializer<CustomObject> { @Override public void serialize( ...
user762421's user avatar
2 votes
1 answer
625 views

I have 2 classes as such class Parent { private final Optional<Child> child; @JsonCreator Parent(@JsonProperty("child") Optional<Child> child) { this.child =...
Paul Schimmer's user avatar
0 votes
1 answer
57 views

Traditional object mapper is used to abstract the code and the database in typical use cases. In my scenario, I am using spark to read data from source and converting to dataframe. The target for my ...
Sanjeev Kumar's user avatar
-1 votes
1 answer
36 views

I am working on Java Object to JSON conversion using ObjectMapper but it is giving extra attribute which is not present in my java class. Below is the Java Object Builder class. @JsonDeserialize(...
Shahrukh Ali's user avatar
0 votes
1 answer
57 views

Let's say I have the following Json data, here I have the id of type integer, and in Java class the type of id is String. { "id": 1, "name": "user1" } @lombok.Data @...
prince's user avatar
  • 47
0 votes
2 answers
838 views

I am currently working with Quarkus, and I encountered an issue while wanting to deserialise a JSON String message recieved through a WebSocket to a CloudEvent. Using the Quarkus ObjectMapper doesn't ...
Robin Hugues's user avatar
0 votes
1 answer
102 views

I have the following JSON: { "code":1000, "message":"Success", "data":{ "results":[ { "lineId":"...
Shanky's user avatar
  • 23

1
2 3 4 5
24