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/TemplateBuilderUtil.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/TemplateBuilderUtil.java index a0b04bc18049..7dbd08d86dde 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/TemplateBuilderUtil.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/TemplateBuilderUtil.java @@ -673,12 +673,14 @@ private static GatewayAPIDTO createAPIGatewayDTOtoPublishAPI(Environment environ GatewayUtils.setCustomSequencesToBeRemoved(apiProduct.getId(), api.getUuid(), productAPIDto); APITemplateBuilder apiTemplateBuilder = new APITemplateBuilderImpl(api, apiProduct); // check the endpoint type - if (api.getEndpointConfig() != null) { + if (!StringUtils.isEmpty(api.getEndpointConfig())) { JsonObject endpointConfObj = JsonParser.parseString(api.getEndpointConfig()).getAsJsonObject(); if (!APIConstants.ENDPOINT_TYPE_SEQUENCE.equals( endpointConfObj.get(APIConstants.API_ENDPOINT_CONFIG_PROTOCOL_TYPE).getAsString())) { addEndpoints(api, apiTemplateBuilder, productAPIDto); } + } else { + addEndpoints(api, apiTemplateBuilder, productAPIDto); } setCustomSequencesToBeAdded(apiProduct, api, productAPIDto, apiExtractedPath, apidto); setAPIFaultSequencesToBeAdded(api, productAPIDto, apiExtractedPath, apidto);