Subject: [scim] Pagination Question

From: Shelley <[email-masked]>
Date: Wed, 6 Nov 2013 13:51:27 -0600

I'd appreciate some clarification on some of the SCIM pagination behavior,
particularly as it relates to situations when the "startIndex" and/or
"count" exceed the total number of results.

Given the following example scenarios, assume there are 19 total users, and
the SP has configured a default maxResults of 10. (The schemas attribute
and actual resources have been omitted for brevity and applicability with
both SCIM 1.1 and 2.0.)

*Scenario 1*
*GET /Users?startIndex=2*
{
  "totalResults":19,
  "itemsPerPage":10,
  "startIndex":2,
  "Resources":[
*    ...users 2-11...*
  ]
}
Is this the correct behavior, such that the "current" page contains the
default "itemsPerPage" despite the "previous" page being a different size?

*Scenario 2*
*GET /Users?startIndex=19&count=10*
{
  "totalResults":19,
  "itemsPerPage":1,
  "startIndex":19,
  "Resources":[
*    ...user 19...*
  ]
}
Despite the requested page size being 10, the actual number of resources
returned is only 1. In this situation, is it correct for the SP to return
"1" for the "itemsPerPage" or should this value instead be 10?

*Scenario 3*
*GET /Users?startIndex=20*
{
  "totalResults":19,
  "itemsPerPage":0,
  "startIndex":20,
  "Resources":[
*    ...no users/empty array...*
  ]
}

*-OR-*{
  "Errors":[
    {
      "description":"startIndex exceeded totalResults",
      "code":"400"
    }
  ]
}
If the requested startIndex is greater than the total number of results,
what should the SP return? Is this an error condition? If not, what are the
appropriate values for the startIndex and itemsPerPage?

Thank you!

---

From: Shelley <[email-masked]>
Date: Fri, 15 Nov 2013 08:44:13 -0600

The SCIM specification defines the *startIndex *for a pagination response
as a "1-based index of the first result in the current set of search
results". However, what is an appropriate value for this attribute if
pagination is requested but *the requested startIndex is greater than the
total number of results*? Also, what is an appropriate value (if any) if
there are *no results*?

Further, the specification defines *itemsPerPage *as a "non-negative
integer" which "specifies the number of search results returned in a query
response page". If pagination is requested by the consumer, but there are *no
results*, is it appropriate to return *0* for this value?

For more details and examples regarding these questions, please review the
previous post [1].

[1] http://www.ietf.org/mail-archive/web/scim/current/msg01361.html

On Wed, Nov 6, 2013 at 1:51 PM, Shelley <[email-masked]> wrote:

> Given the following example scenarios, assume there are 19 total users,
> and the SP has configured a default maxResults of 10. (The schemas
> attribute and actual resources have been omitted for brevity and
> applicability with both SCIM 1.1 and 2.0.)
>
> *Scenario 1*
> *-OR- *{

---

From: Phil Hunt <[email-masked]>
Date: Fri, 15 Nov 2013 16:20:44 -0800

Shelley,

+1 to your questions (both emails).

I don't think most of these matter much.  Just that we pick a particular behaviour for interop consistency.

Phil

@independentid
www.independentid.com
[email-masked]

On 2013-11-15, at 6:44 AM, Shelley <[email-masked]> wrote:

> The SCIM specification defines the startIndex for a pagination response as a "1-based index of the first result in the current set of search results". However, what is an appropriate value for this attribute if pagination is requested but the requested startIndex is greater than the total number of results? Also, what is an appropriate value (if any) if there are no results?
> 
> Further, the specification defines itemsPerPage as a "non-negative integer" which "specifies the number of search results returned in a query response page". If pagination is requested by the consumer, but there are no results, is it appropriate to return 0 for this value?
> 
> For more details and examples regarding these questions, please review the previous post [1].
> 
> I'd appreciate some clarification on some of the SCIM pagination behavior, particularly as it relates to situations when the "startIndex" and/or "count" exceed the total number of results.
> 
> Given the following example scenarios, assume there are 19 total users, and the SP has configured a default maxResults of 10. (The schemas attribute and actual resources have been omitted for brevity and applicability with both SCIM 1.1 and 2.0.)
> 
> Scenario 1
> GET /Users?startIndex=2
> {
>   "totalResults":19,
>   "itemsPerPage":10,
>   "startIndex":2,
>   "Resources":[
>     ...users 2-11...
>   ]
> }
> Is this the correct behavior, such that the "current" page contains the default "itemsPerPage" despite the "previous" page being a different size?
> 
> Scenario 2
> GET /Users?startIndex=19&count=10
> {
>   "totalResults":19,
>   "itemsPerPage":1,
>   "startIndex":19,
>   "Resources":[
>     ...user 19...
>   ]
> }
> Despite the requested page size being 10, the actual number of resources returned is only 1. In this situation, is it correct for the SP to return "1" for the "itemsPerPage" or should this value instead be 10?
> 
> Scenario 3
> GET /Users?startIndex=20
> {
>   "totalResults":19,
>   "itemsPerPage":0,
>   "startIndex":20,
>   "Resources":[
>     ...no users/empty array...
>   ]
> }
> -OR-
> {
>   "Errors":[
>     {
> If the requested startIndex is greater than the total number of results, what should the SP return? Is this an error condition? If not, what are the appropriate values for the startIndex and itemsPerPage?
> 
> Thank you!
> 
> _______________________________________________
> scim mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/scim