Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GroupApi listGroupsWithPaginationInfo fails when q is specified #870

Closed
chairbender opened this issue May 16, 2023 · 2 comments
Closed

GroupApi listGroupsWithPaginationInfo fails when q is specified #870

chairbender opened this issue May 16, 2023 · 2 comments
Assignees

Comments

@chairbender
Copy link

chairbender commented May 16, 2023

Describe the bug?

Invoke GroupApi.listGroupsWithPaginationInfo with a "q" value specified (a group name), and all other params null, such that only one group matches.

In this situation, the underlying Okta API returns no "link" header, which causes the SDK to erroneously throw an exception:

[Assertion failed] - this argument is required; it must not be null
java.lang.IllegalArgumentException: [Assertion failed] - this argument is required; it must not be null
	at com.okta.commons.lang.Assert.notNull(Assert.java:81)
	at com.okta.commons.lang.Assert.notNull(Assert.java:92)
	at com.okta.sdk.resource.common.PagedList.constructPagedList(PagedList.java:88)
	at org.openapitools.client.api.GroupApi.listGroupsWithPaginationInfo(GroupApi.java:1973)

What is expected to happen?

It should return the group with the matching group name and not throw exception.

What is the actual behavior?

It throws exception when there is nothing wrong.

Reproduction Steps?

See description.

Additional Information?

I suggest treating a missing "link" header as equivalent to there being no more pages of results to fetch, rather than treating it as an exception. Or, if possible, fix the underlying Okta API so that it properly returns the link header even though there is only one result, so its behavior is more consistent.

Java Version

17.0.4.1

SDK Version

10.3.0

OS version

No response

@arvindkrishnakumar-okta
Copy link
Contributor

@chairbender Thanks for posting!

Will get this fixed - Internal Ref OKTA-611326

@arvindkrishnakumar-okta
Copy link
Contributor

With the latest major release 12.0.0, the methods listXYZWithPaginationInfo(..) are removed. You will now receive pagination information in the existing listXYZ(..) methods (whenever a list of models are returned by the API).

Please refer to the section https://github.com/okta/okta-sdk-java#pagination for a sample.

I would close this issue now, feel free to reopen if you have followup questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants