diff --git a/open-banking-accelerator/internal-apis/internal-webapps/com.wso2.openbanking.accelerator.application.info.endpoint/src/main/java/com/wso2/open/banking/application/info/endpoint/api/impl/ApplicationInformationApiServiceImpl.java b/open-banking-accelerator/internal-apis/internal-webapps/com.wso2.openbanking.accelerator.application.info.endpoint/src/main/java/com/wso2/open/banking/application/info/endpoint/api/impl/ApplicationInformationApiServiceImpl.java index 1cdb0806..b71239ac 100644 --- a/open-banking-accelerator/internal-apis/internal-webapps/com.wso2.openbanking.accelerator.application.info.endpoint/src/main/java/com/wso2/open/banking/application/info/endpoint/api/impl/ApplicationInformationApiServiceImpl.java +++ b/open-banking-accelerator/internal-apis/internal-webapps/com.wso2.openbanking.accelerator.application.info.endpoint/src/main/java/com/wso2/open/banking/application/info/endpoint/api/impl/ApplicationInformationApiServiceImpl.java @@ -21,6 +21,7 @@ import com.wso2.open.banking.application.info.endpoint.api.ApplicationInformationApi; import com.wso2.open.banking.application.info.endpoint.api.data.MetaDataDAOImpl; import com.wso2.open.banking.application.info.endpoint.api.utils.MappingUtil; +import com.wso2.open.banking.application.info.endpoint.model.ApplicationBulkMetadataSuccessDTO; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -110,7 +111,14 @@ public Response getAllApplicationMetadata() { List clientIdList = metaDataDAOImpl.getAllDistinctClientIds(); - return getBulkApplicationMetadata(clientIdList); + if (!clientIdList.isEmpty()) { + return getBulkApplicationMetadata(clientIdList); + } + + // Responding with an empty ApplicationBulkMetadataSuccessDTO when no data is available + return Response.ok() + .entity(new ApplicationBulkMetadataSuccessDTO()) + .build(); }