algoliasearch-client-java icon indicating copy to clipboard operation
algoliasearch-client-java copied to clipboard

Making ObjectMapper injectable

Open Ant-hem opened this issue 6 years ago • 4 comments

What do you think of letting our users inject their own ObjectMapper? It could be injected like the HTTP Client. I am opening this issue because it's not the first time I got the request.

WDYT? @BenoitPerrot @aseure

Ant-hem avatar Oct 04 '19 14:10 Ant-hem

Disclaimer: I'm not sure of all the implications it would have.

My initial thought is that it could lead to users reporting issues with failed serialization/deserialization of legit Algolia requests and responses (correct me if I'm wrong here @BenoitPerrot).

Side question: are there things which cannot be done because the ObjectMapper is not injectable?

aseure avatar Oct 07 '19 12:10 aseure

Also found a stackoverflow question about it.

Thing is, we were allowing it in the v2 of the client.

Ant-hem avatar Oct 07 '19 13:10 Ant-hem

Hi, Is there any update on this?

Benji1109 avatar Aug 05 '22 09:08 Benji1109

This is a really necessary feature

For example where Algolia fields are snake case e.g. number_of_employees, it would have been great just to define a

@JsonProperty("number_of_employees")
Integer employees;

This keeps Algolia schema design from polluting Java coding standards, as now I am forced to have a property in my class called.

Integer number_of_employees;

Also because ObjectMapper is not injectable or SearchConfig extendable I cannot override this.

tomaytotomato avatar Jul 15 '24 18:07 tomaytotomato