Skip to main content

All Questions

Tagged with
0 votes
1 answer
36 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
-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
34 views

Spring @Autowired in mapped object from Jackson ObjectMapper

Is there a way to get @Autowired Objects initialized properly inside a newly created Object that came from objectMapper.readValue()? BaseEventInfo eventInfo = objectMapper.readValue(eventJson, ...
coloradoman's user avatar
2 votes
0 answers
90 views

Jackson fails due FAIL_ON_TRAILING_TOKENS but feature is disabled

I'm trying to migrate my Spring Boot app from 3.0 to 3.3. I have some complex JSON sent from the frontend so the ObjectMapper is configured like this @Bean public Module dateSerializationModule() { ...
alvinmeimoun's user avatar
  • 1,502
-1 votes
1 answer
123 views

jackson ObjectMapper class no longer in jackson-databind?

I am updating an existing application from Spring-boot 2.x to 3.3.0 and Jackson 2.17.1. Spring Boot pulls in Spring Framework 6.1.8. There seems to be a class from jackson-databind that has ...
user1071914's user avatar
  • 3,383
0 votes
1 answer
105 views

Is There A Better Way To Override The Default MappingJackson2HttpMessageConverter Used By RestClient In Springboot

I need to override the default ObjectMapper dependency (and its default configurations) of MappingJackson2HttpMessageConverter when using the RestClient class of Springboot. Not every 3rd party API I ...
user1530263's user avatar
0 votes
0 answers
60 views

Why @RequestBody needs @Getter in Spring

I know about @RequestBody use deserialize concept of Jackson's ObjectMapper. Also I know Jackson ObjectMapper use Reflection. Now the problem here is that reflection can set a private field, so I don'...
DW_Cod's user avatar
  • 41
0 votes
3 answers
135 views

How to easily serialize and deserialize maps with null keys with Jackson

I'm using Spring Boot with the autoconfigured objectMapper. Suppose I need to serialize and deserialize various HashMaps whose keys can be null. AFAIK this is not supported by default. So, how to do ...
amseager's user avatar
  • 6,223
0 votes
2 answers
246 views

Do we need to serialize and Deserialize JSON object Manually in spring boot?

I am a new Java developer and working on an ERP Project. I went through the codebase of my project and found some interesting and pretty complex coding structure. The entire application was developed ...
Alex Jones's user avatar
0 votes
1 answer
60 views

Jackson parsing issue

In my spring applicaiton, I have Rest api, when I call it using postman and sending this json { "incomeValue":"Test\\t" } It gives Caused by: com.fasterxml.jackson.core....
user3586286's user avatar
1 vote
1 answer
77 views

Writing all null string values as empty string in Spring app RestController responses

I have a Spring app that has a react front end. The front end wants null string values to be represented as "" instead of null. Is there a way to do this without having to annotate every ...
digitaljoel's user avatar
  • 26.5k
0 votes
0 answers
44 views

Jackson - Don't allow field in JSON response

I have a Spring MVC app with DTO/Entity representations of a User. Users can be created through an API. The password is hashed and saved in a database. We do NOT want to include the hashed password in ...
Dannenberger's user avatar
0 votes
0 answers
32 views

Modify ObjectMapper by Adding New Deserializer

I have a deserialiser: public class TrimStringDeserializer extends JsonDeserializer<String> implements ContextualDeserializer { @Override public JsonDeserializer<String> ...
GaripTipici's user avatar
0 votes
1 answer
234 views

Why Jackson needs a default constructor?

I am using Java Spring Boot for my project and I have the following controller: @AllArgsConstructor @RestController @RequestMapping("/api/subject") public class SubjectController { ...
Alexandru Kullman's user avatar
0 votes
1 answer
57 views

Disable DeserializationFeature.FAIL_ON_NULL_CREATOR_PROPERTIES for an endpoint

I am adding an endpoint to an app, which receives a json and in spring this is automatically converted to a DTO I created. Many fields can be null, which I set in Kotlin with question mark and it is ...
user20918149's user avatar

15 30 50 per page
1
2 3 4 5
169