From 44e63ba2ce58f69f7e3583fe7311feaab3bffd22 Mon Sep 17 00:00:00 2001 From: chashikajw Date: Mon, 20 May 2024 22:51:08 +0530 Subject: [PATCH] Fix APIs github, slack urls update issue --- .../publisher/v1/common/mappings/APIMappingUtil.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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/APIMappingUtil.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/APIMappingUtil.java index bb5f7ef885b0..ada56dd8cce5 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/APIMappingUtil.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/APIMappingUtil.java @@ -341,11 +341,15 @@ public static API fromDTOtoAPI(APIDTO dto, String provider) throws APIManagement Map additionalPropertiesMap = dto.getAdditionalPropertiesMap(); if (additionalPropertiesMap != null && !additionalPropertiesMap.isEmpty()) { for (Map.Entry entry : additionalPropertiesMap.entrySet()) { + String propertyKey = null; if (entry.getValue().isDisplay()) { - model.addProperty(entry.getKey() + APIConstants.API_RELATED_CUSTOM_PROPERTIES_SURFIX, - entry.getValue().getValue()); + propertyKey = entry.getKey() + APIConstants.API_RELATED_CUSTOM_PROPERTIES_SURFIX; } else { - model.addProperty(entry.getKey(), entry.getValue().getValue()); + propertyKey = entry.getKey(); + } + // If this property already added from the additional properties, avoid overriding it + if (propertyKey != null && !model.getAdditionalProperties().containsKey(propertyKey)) { + model.addProperty(propertyKey, entry.getValue().getValue()); } } }