meilisearch-java icon indicating copy to clipboard operation
meilisearch-java copied to clipboard

Agree on a Json library

Open ezienecker opened this issue 3 years ago • 1 comments

I was a bit surprised when I saw that in the project on the one hand Gson and on the other hand org.json.Json is used. I think it would be better to agree on a framework. On the other hand I noticed that the Settings contains logic where I think it would be better in SettingsHandler. It would be easier to map this logic with Gson. According to Gson the following applies:

The default behaviour that is implemented in Gson is that null object fields are ignored. This allows for a more compact output format; however, the client must define a default value for these fields as the JSON format is converted back into its Java form.

Let me know what you think about it

ezienecker avatar Oct 17 '21 09:10 ezienecker

Thanks, @ezienecker, for this discussion. I totally agree with you I think it would be better to get just one JSON handler and it could be Gson. I didn't have too much time to do maintenance on this repo, but I know that at some point it was desired to allow the user to use the handler of his choice. If you want to open an issue it would be great!

alallema avatar Oct 18 '21 09:10 alallema