cancel
Showing results for 
Search instead for 
Did you mean: 

How to use json annotations en beans.xml for WsDTO

former_member683444
Discoverer

Hi experts.

Im working in hybris with rest ws ant I triyng to sending a receiving a date with the format "yyyy-MM-dd"

I have configured commercewebservices-beans.xml from this way

<bean proyect.objectWsDTO>
 <import type="com.fasterxml.jackson.annotation.JsonFormat" />
 <import type="com.fasterxml.jackson.core.JsonGenerator"/>
 <import type="com.fasterxml.jackson.core.JsonProcessingException"/>
 <import type="com.fasterxml.jackson.databind.JsonSerializer"/>
 <import type="com.fasterxml.jackson.databind.ObjectMapper"/>
 <import type="com.fasterxml.jackson.databind.SerializerProvider"/>
 <import type="com.fasterxml.jackson.databind.annotation.JsonSerialize"/>
 <property name="requestedDeliveryDate" type="java.util.Date"><br>  <annotations>@JsonSerialize(as = Date.class)</annotations>  <br>  <annotations>@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")</annotations><br> </property><br></bean>

But when I get dto from server data attribute its still whit format 2020-06-10T13:37:36+0000

And if I send whit form 2020-06-10 not works beacuse cant unmarshal

I have seen that label annotations can be used 3 times in each attribute, but when create class only last one annotation is taked in bean

Im using hybris 1905

Thank in advance

Accepted Solutions (0)

Answers (0)