algolia / algoliasearch-client-kotlin

⚡️ A fully-featured and blazing-fast Kotlin/Android API client to interact with Algolia.
https://www.algolia.com/doc/api-client/getting-started/install/kotlin/
MIT License
59 stars 23 forks source link

[bug]: When using SearchSingleIndex, passing offset & length still requires the key 'page' #425

Closed andrasfecz closed 2 months ago

andrasfecz commented 2 months ago

Description

When passing offset and length as parameters into searchSingleIndex getting an error about 'page' missing. Page should not be required if using offset & length.

Happens with: implementation "com.algolia:algoliasearch-client-kotlin:3.3.0"

Client

Search

Version

3.3.0

Relevant log output

com.algolia.client.exception.AlgoliaClientException: Illegal input: Key page is missing in the map.
    at com.algolia.client.exception.internal.ThrowableKt.asClientException(Throwable.kt:10)
    at com.algolia.client.transport.internal.KtorRequester.onError(KtorRequester.kt:109)
    at com.algolia.client.transport.internal.KtorRequester.execute(KtorRequester.kt:74)
    at com.algolia.client.transport.internal.KtorRequester$execute$1.invokeSuspend(Unknown Source:14)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:102)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:811)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:715)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:702)
Caused by: io.ktor.serialization.JsonConvertException: Illegal input: Key page is missing in the map.
Fluf22 commented 2 months ago

Hey! 👋🏻 Thank you very much for the report. I managed to reproduce, I'm looking into it