diff --git a/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/gen/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/dto/APIProductInfoDTO.java b/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/gen/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/dto/APIProductInfoDTO.java index bdc2db00a0c1..e2c46f41ef95 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/gen/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/dto/APIProductInfoDTO.java +++ b/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/gen/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/dto/APIProductInfoDTO.java @@ -134,7 +134,7 @@ public APIProductInfoDTO version(String version) { return this; } - + @ApiModelProperty(example = "1.0.0", value = "") @JsonProperty("version") public String getVersion() { @@ -221,7 +221,7 @@ public APIProductInfoDTO monetizedInfo(Boolean monetizedInfo) { return this; } - + @ApiModelProperty(example = "true", value = "") @JsonProperty("monetizedInfo") public Boolean isMonetizedInfo() { @@ -238,7 +238,7 @@ public APIProductInfoDTO businessOwner(String businessOwner) { return this; } - + @ApiModelProperty(example = "Business Owner", value = "") @JsonProperty("businessOwner") public String getBusinessOwner() { @@ -255,7 +255,7 @@ public APIProductInfoDTO businessOwnerEmail(String businessOwnerEmail) { return this; } - + @ApiModelProperty(example = "businessowner@abc.com", value = "") @JsonProperty("businessOwnerEmail") public String getBusinessOwnerEmail() { @@ -272,7 +272,7 @@ public APIProductInfoDTO technicalOwner(String technicalOwner) { return this; } - + @ApiModelProperty(example = "Technical Owner", value = "") @JsonProperty("TechnicalOwner") public String getTechnicalOwner() { @@ -289,7 +289,7 @@ public APIProductInfoDTO technicalOwnerEmail(String technicalOwnerEmail) { return this; } - + @ApiModelProperty(example = "technicalowner@abc.com", value = "") @JsonProperty("TechnicalOwnerEmail") public String getTechnicalOwnerEmail() { 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 49f1c5e62e20..d7aaf5d1834a 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 @@ -1570,7 +1570,7 @@ private static void setMaxTpsFromModelToApiDTO(API api, APIDTO dto) { * @return REST API DTO representation of API Lifecycle state information */ public static LifecycleStateDTO fromLifecycleModelToDTO(Map apiLCData, - boolean apiOlderVersionExist) { + boolean apiOlderVersionExist, String apiType) { LifecycleStateDTO lifecycleStateDTO = new LifecycleStateDTO(); @@ -1601,7 +1601,12 @@ public static LifecycleStateDTO fromLifecycleModelToDTO(Map apiL } LifecycleStateCheckItemsDTO checkItemsDTO = new LifecycleStateCheckItemsDTO(); - checkItemsDTO.setName(checkListItem.getName()); + if (APIConstants.API_PRODUCT.equals(apiType)) { + checkItemsDTO.setName(checkListItem.getName().replace(APIConstants.API_IDENTIFIER_TYPE, + APIConstants.API_PRODUCT_IDENTIFIER_TYPE)); + } else { + checkItemsDTO.setName(checkListItem.getName()); + } checkItemsDTO.setValue(Boolean.getBoolean(checkListItem.getValue())); //todo: Set targets properly checkItemsDTO.setRequiredStates(new ArrayList<>()); 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/PublisherCommonUtils.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/PublisherCommonUtils.java index a33cd065bb03..68b17c3cf4fe 100755 --- 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/PublisherCommonUtils.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/PublisherCommonUtils.java @@ -1997,15 +1997,16 @@ public static LifecycleStateDTO getLifecycleStateInformation(Identifier identifi APIProvider apiProvider = RestApiCommonUtil.getLoggedInUserProvider(); Map apiLCData = apiProvider.getAPILifeCycleData(identifier.getUUID(), organization); + String apiType; + if (identifier instanceof APIProductIdentifier) { + apiType = APIConstants.API_PRODUCT; + } else { + apiType = APIConstants.API_IDENTIFIER_TYPE; + } + if (apiLCData == null) { - String type; - if (identifier instanceof APIProductIdentifier) { - type = APIConstants.API_PRODUCT; - } else { - type = APIConstants.API_IDENTIFIER_TYPE; - } - throw new APIManagementException("Error while getting lifecycle state for " + type + " with ID " - + identifier, ExceptionCodes.from(ExceptionCodes.LIFECYCLE_STATE_INFORMATION_NOT_FOUND, type, + throw new APIManagementException("Error while getting lifecycle state for " + apiType + " with ID " + + identifier, ExceptionCodes.from(ExceptionCodes.LIFECYCLE_STATE_INFORMATION_NOT_FOUND, apiType, identifier.getUUID())); } else { boolean apiOlderVersionExist = false; @@ -2021,7 +2022,7 @@ public static LifecycleStateDTO getLifecycleStateInformation(Identifier identifi break; } } - return APIMappingUtil.fromLifecycleModelToDTO(apiLCData, apiOlderVersionExist); + return APIMappingUtil.fromLifecycleModelToDTO(apiLCData, apiOlderVersionExist, apiType); } }