algolia / algoliasearch-client-csharp

⚡️ A fully-featured and blazing-fast C# API client to interact with Algolia.
https://www.algolia.com/doc/api-client/getting-started/install/csharp/
MIT License
120 stars 61 forks source link

GetObjectAsync has wrong comma encoded in URL when attributesToRetrieve #850

Closed MarufSaidov6 closed 8 months ago

MarufSaidov6 commented 9 months ago

Algolia Client Version: 6.16.0 Language Version: .net 6.0

Description

When using the GetObjectAsync<T> method with a list of attributesToRetrieve, the attributes are double-encoded. This behavior leads to incorrect query parameters being sent to Algolia, causing the API to return unexpected results or errors. Specifically, commas between attributes are encoded as %252C instead of %2C.

Expected Behavior

The attributes in the attributesToRetrieve parameter should be correctly encoded once, turning commas into %2C, and the API should return the object with only the requested attributes.

Actual Behavior

The attributes are double-encoded, with commas turning into %252C. The API call does not return the expected results because the query parameters are not correctly interpreted by the Algolia API.

morganleroi commented 8 months ago

A new version of the API is now released (in Alpha) and this issue is fixed.

The Alpha version is now released on Nuget.

If you have time, we need customer feedback about this new version. It's still not GA so you may not want to use it in production.

There is no more deps on Newtonsoft, all Algolia APIs are now available (Insights, Recommend, Query Perso, ...) and all models and routes are synced.

To help you migrate, there is a Migration guide.

Happy to help in your migration process !