Hilla Endpoint Serialization with Jackson

Hi everyone.
According to this page (https://hilla.dev/docs/advanced/custom-serialization), it should be possible to control serialization using Jackson. However, when I put the annotation @JsonProperty(“contact_type_id”) on the getter of my field (private Long contactTypeId) the typescript serializer still produces the field name “contactTypeId”. If it at least mapped correctly I could live with it, but it doesn’t. Due to a dependency I have to use these field names (underscores). Even if my DTO uses underscores the typescript serializer still produces the same field names… Is there any way to control this better?
Thanks. Meinhard.

Hi, unfortunately it’s a known issue that using @JsonProperty is not properly reflected in generated TypeScript. See: https://github.com/vaadin/hilla/issues/322.

As a workaround for now, I’d suggest to rename the DTO class fields themselves to use underscores. Hope this helps.