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

Ensure consequence.params.ignorePlurals can be deserialized from string

Open aseure opened this issue 4 years ago • 1 comments

It was discovered that the Algolia Search API is sometimes returning the ignorePlurals field from a Query Rule's consequence params field as a string, such as:

"consequence": {
    "params:" {
        "ignorePlurals": "false"
    }
}

Could you please ensure that the deserialization of query rules coming from getRule, getRules, browseRules are correctly decoding those strings without failing.

Also, like we did for other string-based booleans, it would be convenient to convert the string to an actual boolean when the string is equal to "true" or "false".

aseure avatar Jun 02 '20 13:06 aseure

https://github.com/algolia/algoliasearch-client-csharp/blob/d62f15ebd5964b54fec3d9e06380bf379c7ad86b/src/Algolia.Search/Models/Search/Query.cs#L372-L376

It should be OK, but I'd rather add a UT for it.

Ant-hem avatar Jun 03 '20 09:06 Ant-hem

Hello,

We just released a new version of the client (7.0) and this issue is now fixed.

From the specs, I can confirm that ignorePlurals can be a bool or a list of string.

morganleroi avatar Feb 21 '24 12:02 morganleroi