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

feat (jans-config-api) : need to add pagination parameters in request and response of jans-config-api apis #2156

Closed
duttarnab opened this issue Aug 17, 2022 · 4 comments · Fixed by #2232 or #2408
Assignees
Labels
comp-jans-config-api Component affected by issue or PR enhancement kind-feature Issue or PR is a new feature request
Milestone

Comments

@duttarnab
Copy link
Contributor

duttarnab commented Aug 17, 2022

Is your feature request related to a problem? Please describe.

The server-side pagination is the performance efficient technique when amount of data is large.

Describe the solution you'd like

In order to implement server-side pagination on applications (like admin-UI, jans-cli etc) using jans-config-api, we need to add the following pagination parameters in all GET apis (fetching multiple records).

In Request (query parameters to be added)

startIndex - This is the page index

limit - This is the number of rows that will be displayed per page.

Response (parameters to be added)

totalItems - This is the number of records/rows in the database.

Example

Request:
curl -X GET -i 'http://<hostname>/jans-config-api/api/v1/openid/clients?startIndex=1&limit=10'

Response:

{
data: [{}, {}, {}, ...],
totalItems: 345
}

cc: @yuriyz @devrimyatar

@duttarnab duttarnab added comp-jans-config-api Component affected by issue or PR enhancement labels Aug 17, 2022
@mo-auto mo-auto added the kind-feature Issue or PR is a new feature request label Aug 17, 2022
@moabu moabu added this to the 1.0.2 milestone Aug 22, 2022
@pujavs
Copy link
Contributor

pujavs commented Aug 24, 2022

working on this

@pujavs
Copy link
Contributor

pujavs commented Aug 29, 2022

Implemented the change for Attribute endpoint /jans-config-api/api/v1/attributes. Kindly review and confirm if good to be repeated to other endpoints

params:

  1. limit: Search size - max size of the results to return.
  2. pattern: Search pattern.
  3. string : Status of the attribute
  4. startIndex: The 1-based index of the first query result.
  5. sortBy: Attribute whose value will be used to order the returned response.
  6. sortOrder: Order in which the sortBy param is applied. Allowed values are "ascending" and "descending".

Response structure:

{ "totalItems": 0, "entriesCount": 0, "data": [ {} ]}

Testing:

Issue_2156_Pagination.xlsx

@moabu moabu modified the milestones: 1.0.2, 1.0.3 Aug 30, 2022
@pujavs pujavs reopened this Sep 9, 2022
@pujavs
Copy link
Contributor

pujavs commented Sep 9, 2022

Attributes changes for paginations has been verified and confirmed to be as expected. Re-opening as need to incorporate the pagination for other endpoints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-jans-config-api Component affected by issue or PR enhancement kind-feature Issue or PR is a new feature request
Projects
None yet
4 participants