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

API pagination inconsistency in Developer Portal #4869

Closed
tgtshanika opened this issue May 27, 2019 · 2 comments · Fixed by wso2/carbon-apimgt#10913
Closed

API pagination inconsistency in Developer Portal #4869

tgtshanika opened this issue May 27, 2019 · 2 comments · Fixed by wso2/carbon-apimgt#10913
Assignees
Labels
4.x.x APIM - 4.1.0 APIM manager 4.1.0 release related issues. Type/Improvement
Projects
Milestone

Comments

@tgtshanika
Copy link
Contributor

tgtshanika commented May 27, 2019

Description

When showing APIs in Developer Portal, we are only showing the latest version when there are multiple API versions. But the APIs are not properly aligned into pages. The reason is that the filtering for latest version and pagination is done from the code level after retrieving APIs with versions from the DB (registry).

Solutions

APIs needs to be filtered properly (with the latest version) from the persistence level (Registry) itself.

There are a few ways we can check:

  • Check whether we can achieve this from solr level itself by a proper aggregation query
  • If not possible, add a property with a number representing the version of the API when the API is published. Then search and get the API with maximum number for each name.
  • If not possible, we can use a property (eg: latest:true) based search. The property needs to be properly updated when a new API's lifecycle change happened (this is the hardest approach and also need a migration). eg:
    • API1:1.0.0 created
    • API1:1.0.0 published => API1:1.0.0 latest:true
    • API1:2.0.0 created => API1:1.0.0 latest:true
    • API1:2.0.0 published => API1:1.0.0 latest:false, API1:2.0.0 latest:true
    • API1:2.0.0 deleted => API1:1.0.0 latest:true
@tgtshanika tgtshanika added Type/Bug Priority/Normal 2.0.0 DEPRECATED Label; Use Affected/2.0.0 instead 3.0.0 DEPRECATED Label; Use Affected/3.0.0 instead labels May 27, 2019
@rmsamitha rmsamitha added Affected/3.0.0 and removed 3.0.0 DEPRECATED Label; Use Affected/3.0.0 instead labels Jul 11, 2020
@malinthaprasan malinthaprasan changed the title API pagination issue in store API pagination inconsistency in Developer Portal Aug 26, 2021
@tgtshanika tgtshanika added this to Backlog in APIM 4.1.0 Sep 13, 2021
@tgtshanika tgtshanika moved this from Backlog to Epics in APIM 4.1.0 Sep 13, 2021
@isharac isharac moved this from Epics to In progress in APIM 4.1.0 Sep 21, 2021
@isharac
Copy link
Contributor

isharac commented Oct 5, 2021

This can be achieved with a solr query
group=true&group.field=name&group.ngroups=true&group.sort=version desc

However, with the default sorting, if we have API version as 1.0.0. 2.0.0 10.0.0 the latest version is selected as 2.0.0 instead of 10.0.0 because version is considered as a string

@isharac
Copy link
Contributor

isharac commented Oct 14, 2021

To fix the above issue it has introduced a new field in solr which sets a timestamp to each API version created. Based on that latest API version is fetched to display in the devportal when displayMultipleVersions config is not enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x.x APIM - 4.1.0 APIM manager 4.1.0 release related issues. Type/Improvement
Projects
No open projects
5 participants