Skip to content

Commit

Permalink
Merge pull request #149 from aka4rKO/3.0.0-consentmgr-fix
Browse files Browse the repository at this point in the history
[OB3][ConsentMgr] Added an empty success response when consent data is not available
  • Loading branch information
hasithakn authored Oct 22, 2024
2 parents 3292396 + 3890206 commit ca88e0d
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 ca88e0d

Please sign in to comment.