Open rbrki07 opened 2 weeks ago
We need to make sure that the correct Jackson mapper is used. One issue is that it's difficult to share the mapper for the signals constructor. Related issue: #2786, one approach to fix there relies on JSON mapper.
Let's expose a static method in the signals library that enables setting the Jackson ObjectMapper
. Before the call, the built-in mapper is null
, so any interaction with it will throw.
Hilla automaticalliy initializes signals using the same mapper with regular endpoint requests.
Describe the bug
I want to use the new
ListSignal
with a Java Record that contains a field of typeLocalDateTime
. This is currently not possible, as a request from the frontend to the backend containing such a field cannot be deserialized due to a Jackson data binding error.Expected-behavior
I'm able to use the new
ListSignal
with a Java Record that contains a field of typeLocalDateTime
,LocalDate
orInstant
.Reproduction
ChatService
like this:import java.time.LocalDateTime;
import com.vaadin.flow.server.auth.AnonymousAllowed; import com.vaadin.hilla.BrowserCallable; import com.vaadin.hilla.signals.ListSignal;
@BrowserCallable @AnonymousAllowed public class ChatService {
}
If you submit a new message to the backend, you will see the following error in the backend logs:
System Info
24.6.0.alpha2