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

[APIM 3.1.0] Admin API - /applications resources does not return pagination #3487

Open
saranki opened this issue Mar 16, 2021 · 1 comment
Open

Comments

@saranki
Copy link

saranki commented Mar 16, 2021

Description:

When querying the /applications API, pagination details are not returned. Furthermore, the following issues also exist.

  • The "next" or "previous" values are not always returned even if there are valid values for them.
  • When a limit is given, the "groupId" property returned in the "previous" value makes no sense, and would probably improperly return (i.e. &groupId={groupId})
  • When both limit and offset are given, the limit minus offset is the total results returned from the API
  • The total number of results is never returned especially when the limit is used as the parameter. So there's no indication of the total number of results. E.g: could be 2, could be 6000, etc.

Steps to reproduce:

  1. Follow the steps in https://apim.docs.wso2.com/en/3.1.0/develop/product-apis/admin-apis/admin-v0.16/admin-v0.16/#section/Authentication for dynamic client registration
  2. Follow the steps in https://apim.docs.wso2.com/en/3.1.0/develop/product-apis/admin-apis/admin-v0.16/admin-v0.16/#tag/Application-(Collection)/paths/~1applications/get to retrieve application details
Request:
curl -k -H "Authorization: Bearer 6b0af803-68d7-3ff2-b2e6-739cac3f5b46" "https://127.0.0.1:9443/api/am/admin/v0.16/applications"

Response: 
{"count":11,"next":"","previous":"","list":[{"applicationId":"a915fa17-e8f9-40ad-9e4f-2df1b4810f77","name":"DefaultApplication","owner":"admin","status":"APPROVED","groupId":""},{"applicationId":"a59eabd9-f4ba-453c-896c-9689cb7cf7a2","name":"App1","owner":"admin","status":"APPROVED","groupId":null},{"applicationId":"435f4358-3909-4a19-9cae-202a0e89965a","name":"App2","owner":"admin","status":"APPROVED","groupId":null},{"applicationId":"3b546577-e430-4234-90dc-c6e3e8e2bf8f","name":"App3","owner":"admin","status":"APPROVED","groupId":null},{"applicationId":"bf2656eb-6c8b-4034-9838-e946da6eb971","name":"App4","owner":"admin","status":"APPROVED","groupId":null},{"applicationId":"0e085577-67cb-4b1d-9559-679447355303","name":"App5","owner":"admin","status":"APPROVED","groupId":null},{"applicationId":"2e00dbdd-378f-473a-9852-d8ded74aa6fb","name":"App6","owner":"admin","status":"APPROVED","groupId":null},{"applicationId":"41ca4924-4f22-4353-8a5e-3be674be790c","name":"App7","owner":"admin","status":"APPROVED","groupId":null},{"applicationId":"5b452d40-05b3-414a-89a9-b08fd92a5582","name":"App8","owner":"admin","status":"APPROVED","groupId":null},{"applicationId":"970f2e7c-6db4-4f5f-9f64-25aa30267da3","name":"App9","owner":"admin","status":"APPROVED","groupId":null},{"applicationId":"a4e21c0f-f7ed-4253-88fe-fcfe9ba24d46","name":"App10","owner":"admin","status":"APPROVED","groupId":null}]}

Affected Product Version:

  • APIM-3.1.0
  • APIM-3.2.0
@NethmiRanasinghe
Copy link

NethmiRanasinghe commented Dec 20, 2024

The pagination details are returned, but out of the mentioned issues, point 2 is reproducing where the "groupId" in the next and previous links are improperly returned.

Also the next and previous links are missing a part of the required base path /api/am/devportal/v/ . So it points to an incorrect endpoint.

example response:
{ "count": 1, "list": [ { "applicationId": "3727a3bd-9277-4fcd-a3bf-3c6dbe35b139", "name": "My App", "description": "", "status": "APPROVED", "groups": [], "subscriptionCount": 1, "attributes": {}, "owner": "admin", "tokenType": "JWT", } ], "pagination": { "offset": 1, "limit": 1, "total": 3, "next": "/applications?sortBy=name&sortOrder=asc&limit=1&offset=2&groupId=", "previous": "/applications?sortBy=name&sortOrder=asc&limit=1&offset=0&groupId=" } }

@Krishanx92 Krishanx92 transferred this issue from wso2/product-apim Dec 30, 2024
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