Skip to content

Commit

Permalink
added an empty success response when consents are not created
Browse files Browse the repository at this point in the history
  • Loading branch information
aka4rKO committed Oct 21, 2024
1 parent 3292396 commit 3890206
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -110,7 +111,14 @@ public Response getAllApplicationMetadata() {

List<String> 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();
}


Expand Down

0 comments on commit 3890206

Please sign in to comment.