auth0-java icon indicating copy to clipboard operation
auth0-java copied to clipboard

Add support for checkpoint based pagination when fetching a list of clients

Open PhillipTr01 opened this issue 5 months ago • 2 comments

Changes

Based on the documentation it is possible to use the Query Parameters q, take and from for checkpoint based pagination. The problem was that the library doesn't support this yet. The next value won't be set. Overriding the existing constructor with one that sets the next parameter fixes this.

Testing

There is currently no test suite for checking if pagination is working. Manual Testing is possible by creating a ExtendedClientFilter (in my case i tested it with Kotlin) in your application:

class ExtendedClientFilter : ClientFilter() {
    fun withFromAndTake(
        from: String?,
        take: Int,
    ): ClientFilter {
        if (!from.isNullOrEmpty()) {
            parameters["from"] = from
        }
        parameters["take"] = take

        return this
    }
}

Calling the .clients().list() function returns the next variable in the body.

  • [X] This change has been tested on the latest version of the platform/language

Checklist

PhillipTr01 avatar Aug 08 '25 10:08 PhillipTr01

Hi @PhillipTr01

You’re right, currently the SDK doesn’t support checkpoint pagination properly because the next value isn’t set automatically when using q, from, and take. Overriding the constructor and extending to set those parameters manually works.

That said, there’s a minor refactoring in progress that will affect this endpoint. Once that lands, I’ll update the SDK to reflect the changes (including those related to this endpoint). I’ll keep you posted as things move forward.

Thanks again for raising the PR !!

tanya732 avatar Aug 13 '25 03:08 tanya732

Hey @tanya732, are there any updates on this pull request :)?

PhillipTr01 avatar Sep 17 '25 08:09 PhillipTr01