Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
0 votes
1 answer
23 views

Getting Data from a Jacksonised Object duing unit test

I'm trying to mock out RestServer calls, but It's not generating parseable JSON: A Simple Class like so: @SuperBuilder @Data @Setter @Jacksonized @JsonIgnoreProperties(ignoreUnknown = true) Public ...
gilbo's user avatar
  • 1
1 vote
2 answers
35 views

Jackson Deserialization - Treat specific string values as being null

I am working with an external API and have generated the Java client classes using the OpenAPI generator. One of the fields defined in the response is marked as being of a date type as shown below and ...
Leon's user avatar
  • 538
1 vote
0 answers
41 views

Byte array passthrough via Jackson ObjectMapper

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
0 votes
1 answer
41 views

How to force XmlMapper to retain the root element?

I have the following minimal code: final var xmlString = "<parent><child>data</child></parent>"; final var xmlMapper = XmlMapper.xmlBuilder() .enable(...
Nikolas Charalambidis's user avatar
-2 votes
0 answers
21 views

Retrieve a specific value from JSON array using jackson [duplicate]

I'm trying to retrieve an specific attribute from a JSON that I got from an API response directly into a java object using jackson, but when I print it returns null. The attribute in question is "...
Phillipe Wolff's user avatar
-1 votes
1 answer
47 views

Return whole child DTO inside parentDto [closed]

I have class student and school DTO. Class Student{ private String name; private School school; } Class School{ private String schoolName; private String address; } while returning ...
JAYESH rathi's user avatar
0 votes
1 answer
42 views

Jackson Subtypes - polymorphic code - issue with parsing

Have the following sets of json from a third party API : First type: { "mandateAuthDtls": { "transactionID": "<Transaction ID>", "mndtType": &...
evilo's user avatar
  • 1
1 vote
1 answer
48 views

Issue with Jackson Deserialization Java

I hope you are well, I have a problem when Jackson deserializes a json. Context: I am programming a backend application with Java and Spring boot, where in my controller I request the following object/...
Pedro Rojas's user avatar
-1 votes
0 answers
24 views

(although at least one Creator exists): Jackson error on a static class

There are many sage that talks about fixing this error on a non static class by adding a constructor. I am wondering what is the fix if we have a static class defined as @Value(staticConstructor = &...
Saad's user avatar
  • 933
4 votes
1 answer
36 views

How to get Java 8 time classes to work on Jersey Jax-RS clients?

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
-2 votes
1 answer
32 views

Jackson: new ObjectMapper() createObjectNode is affected by global configurations? [duplicate]

Jackson: new ObjectMapper() createObjectNode is affected by global configurations? Is it safe to use a new ObjectMapper wherever it is needed? Or is better to configure one to use in all application? ...
javi_alt's user avatar
-1 votes
0 answers
53 views

Jackson Serialize Timestamp to Nanosecond Issue

How do I serialize java.sql.Timestamp with Jackson to include nanoseconds? @Test void testTimestampSerialization() throws Exception { var objectMapper = new ObjectMapper(); ...
kavai77's user avatar
  • 6,534
-1 votes
0 answers
61 views

Docker image has java error on one machine but not another

I have a docker image (java tomcat app) that I built and pushed to a private registry. When pulling it onto a remote server and running it I keep getting error 500 and: jakarta.servlet....
Dr. Bright's user avatar
-2 votes
2 answers
71 views

Deserialization error on the 3rd library class instance in the class (using Lombok annotations) [duplicate]

I want to use a 3rd party (external) class instance in a class but I am getting this error on deserialization: Cannot construct instance of org.springframework.data.geo.Point (no Creators, like ...
Eric's user avatar
  • 449
-1 votes
1 answer
40 views

Jackson INDENT_OUTPUT doesn't format properly - what am I doing wrong?

I've been trying to figure this out for a bit but couldn't pin-point my mistake. I have a JSON I'd like to read into Java objects, manipulate those objects, then write them to a new JSON. Code looks ...
anon's user avatar
  • 31

15 30 50 per page
1
2 3 4 5
829