You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
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.
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:
The text was updated successfully, but these errors were encountered: