From 825b6a5cda94b43f6c6843dfe9098a88de1d8464 Mon Sep 17 00:00:00 2001 From: BLasan Date: Mon, 1 Apr 2024 15:32:59 +0530 Subject: [PATCH] fixes: https://github.com/wso2/api-manager/issues/2760 --- .../rest/api/publisher/v1/common/mappings/ImportUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/main/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/common/mappings/ImportUtils.java b/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/main/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/common/mappings/ImportUtils.java index b4a554d76652..9fe907821c83 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/main/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/common/mappings/ImportUtils.java +++ b/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/main/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/common/mappings/ImportUtils.java @@ -189,7 +189,7 @@ public static API importApi(String extractedFolderPath, APIDTO importedApiDTO, B String previousApiProvider = apiProvider.getAPIProviderByNameAndOrganization(importedApiDTO.getName(), RestApiCommonUtil.getLoggedInUserTenantDomain()); - if (!StringUtils.isEmpty(previousApiProvider)) { + if (!StringUtils.isEmpty(previousApiProvider) && !overwrite) { //current provider is updated based on the preserve-provider input. //tenant domain is verified already // [only allows preserve-provider = false in cross tenant. (provider is set to logged-in user)]