algolia / algoliasearch-client-java

⚡️ A fully-featured and blazing-fast Java API client to interact with Algolia.
https://www.algolia.com/doc/api-client/getting-started/install/java/
MIT License
47 stars 33 forks source link

Making ObjectMapper injectable #640

Open Ant-hem opened 4 years ago

Ant-hem commented 4 years ago

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

aseure commented 4 years ago

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?

Ant-hem commented 4 years ago

Also found a stackoverflow question about it.

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

Benji1109 commented 2 years ago

Hi, Is there any update on this?

tomaytotomato commented 1 month ago

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.