Skip to content

Collection.prototype.each doesn't work as expected when using expand query parameter #439

@krzysztof-grzybek

Description

@krzysztof-grzybek

Describe the bug

Issue: expand=user is not preserved across paginated responses when listing application users.

When using the API for listing application users with the expand=user query parameter, the Collection.prototype.each method does not behave as expected.

The first page correctly includes the expanded user object. However, subsequent pages do not — the expand=user parameter is missing from the pagination requests. As a result, the user object is not included in items from those pages.

This occurs because the Link header returned in the initial response does not preserve the expand=user parameter in the next URL. Consequently, the SDK or client library does not continue to request expanded user objects for the remaining pages.

Expected Behavior

Pagination links should retain the expand=user parameter so that expanded user data is consistently included across all pages.

Reproduction Steps?

Run:

curl -i -X GET   'https://subdomain.okta.com/api/v1/apps/{appId}/users?limit=5&expand=user'   -H 'Authorization: YOUR_API_KEY_HERE'

Check the response headers - both self and next link headers do not include expand=user query param.

SDK Versions

Not realted to the SDK version.

Additional Information

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions