You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently working on an Android application using the Kotlin Algolia client.
I have just updated to 3.5.0 and have an issue when using searchClient.getObjects(): if I request for an object that does not exist on Algolia, it returns an array with some "null" values that breaks the Ktor deserialisation.
For exemple:
The request: {"requests":[{"objectID":"222966","indexName":"my_index","attributesToRetrieve":[""]},{"objectID":"314558","indexName":"my_index","attributesToRetrieve":[""]},{"objectID":"317683","indexName":"my_index","attributesToRetrieve":[""]}]}
222966 and 317683 exist on Algolia but not 314558
The response: {"results":[{"objectID":"222966"},null,{"objectID":"317683"}],"message":"ObjectID 314558 does not exist. "}
So it throws and AlgoliaClientException because: io.ktor.serialization.JsonConvertException: Illegal input: Unexpected JSON token at offset 34: Expected start of the object '{', but had 'n' instead at path: $.results[1]
Is there a way to request for objects even if they don't exist on Algolia and get a response like it did in v2? Maybe using a custom Json deserializer?
Thanks
Client
Search
Version
3.5.0
Relevant log output
No response
The text was updated successfully, but these errors were encountered:
Description
Hi,
I'm currently working on an Android application using the Kotlin Algolia client.
I have just updated to 3.5.0 and have an issue when using searchClient.getObjects(): if I request for an object that does not exist on Algolia, it returns an array with some "null" values that breaks the Ktor deserialisation.
For exemple:
The request:
{"requests":[{"objectID":"222966","indexName":"my_index","attributesToRetrieve":[""]},{"objectID":"314558","indexName":"my_index","attributesToRetrieve":[""]},{"objectID":"317683","indexName":"my_index","attributesToRetrieve":[""]}]}
222966 and 317683 exist on Algolia but not 314558
The response:
{"results":[{"objectID":"222966"},null,{"objectID":"317683"}],"message":"ObjectID 314558 does not exist. "}
So it throws and AlgoliaClientException because:
io.ktor.serialization.JsonConvertException: Illegal input: Unexpected JSON token at offset 34: Expected start of the object '{', but had 'n' instead at path: $.results[1]
Is there a way to request for objects even if they don't exist on Algolia and get a response like it did in v2? Maybe using a custom Json deserializer?
Thanks
Client
Search
Version
3.5.0
Relevant log output
No response
The text was updated successfully, but these errors were encountered: