Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration with custom HTTP client and custom json library #511

Open
MWGuy opened this issue Dec 21, 2022 · 5 comments
Open

Integration with custom HTTP client and custom json library #511

MWGuy opened this issue Dec 21, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@MWGuy
Copy link

MWGuy commented Dec 21, 2022

Description

Integration with custom http clients may be helpful if we already has http client in our context, RestTemplate in spring boot for example. This also applies to json serializing/deserializing libraries.

@alallema
Copy link
Contributor

Hi @MWGuy,
Thank you for raising this issue ❤️ , and so sorry for the delay.

Integration with custom http clients may be helpful if we already has http client in our context

This was the case before the refactoring of this SDK. However, after the release of v0.27.0 of Meilisearch, the PATCH http method became mandatory to allow some requests, so we decided to propose only the OKHttp client, which is one of the only ones to propose this method natively.

@alallema alallema added the enhancement New feature or request label Jan 10, 2023
@relufi
Copy link

relufi commented Oct 16, 2024

With the current setup I can't even customize the timeout time of the request, just use the default parameters of okhttp

@relufi
Copy link

relufi commented Oct 16, 2024

For the json part, the search api always returns HashMap<String, Object>, why not use generics?

@relufi
Copy link

relufi commented Oct 16, 2024

What about the default use of new GsonJsonHandler() when building Config, and the fixed use of org.json in the search api's SearchRequest class toString? Why not just use one json library

@brunoocasali
Copy link
Member

Hi @relufi, this library stayed for a long time due to some unfinished refactoring/improvement started by a contributor, and it was our fault for accepting such harmful changes.

After that we decided to simplify the source code here by removing some of the "options" like configuring the HTTP handler. After @alallema's work, we saw the usage increase and also the number of contributions, so we consider it a success!

I agree with you that not being able to configure something as simple as the timeout is not ideal, and I encourage you or anyone else to submit a clear PR with that change. We are more than welcome to accept contributions to all of our integrations, especially when they address real problems, are clear in purpose, useful, and have test coverage!

I hope you understand, that we are a small team and we need to carefully use our time :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants