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
46 stars 33 forks source link

Ensure consequence.params.ignorePlurals can be deserialized from string #695

Closed aseure closed 4 years ago

aseure commented 4 years ago

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".

Ant-hem commented 4 years ago

We support boolean and String[]. I'll have a look for the string support.

https://github.com/algolia/algoliasearch-client-java-2/blob/master/algoliasearch-core/src/main/java/com/algolia/search/models/settings/IgnorePlurals.java