wso2 / charon

123 stars 165 forks source link

Changing the response type of GET and POST/.Search #371

Closed BojithaPiyathilake closed 2 years ago

BojithaPiyathilake commented 2 years ago

Purpose

In my attempts to implement cursor based pagination, it was noticed that the current method of returning the total number of results along with the list of users for GET requests and POST/.Search requests was to allocate the 1st position of a List to carry the total results and the remainder to carry the users. It is not appropriate to store different data types in a List therefore it was decided to refactor the code to change the return type to a custom java object which comprises of the users and total results. With the intention of supporting forwards cursor and backwards cursor for cursor pagination (Implemented here and here).

Goals

The same functionality is maintained while changing the return type from a List to a custom java object.

Related PRs

https://github.com/wso2-extensions/identity-inbound-provisioning-scim2/pull/426

Test environment

Ubuntu 20.04, WSO2IS-5.12.0-beta2-SNAPSHOT

AnuradhaSK commented 2 years ago

PR builder is failing due to the following check style issues. fix them as well

/home/runner/work/charon/charon/modules/charon-core/src/main/java/org/wso2/charon3/core/objects/plainobjects/UsersGetResponse.java:0: error: File does not end with a newline.
/home/runner/work/charon/charon/modules/charon-core/src/main/java/org/wso2/charon3/core/objects/plainobjects/UsersGetResponse.java:25: error: Missing a Javadoc comment.
/home/runner/work/charon/charon/modules/charon-core/src/main/java/org/wso2/charon3/core/protocol/endpoints/UserResourceManager.java:438: error: Line is longer than 120 characters (found 127).