diff --git a/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIConstants.java b/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIConstants.java index c33062ac64fb..102f2ee7d780 100755 --- a/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIConstants.java +++ b/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIConstants.java @@ -1618,6 +1618,8 @@ private ConfigParameters() { public static final String X_WSO2_REQUEST_INTERCEPTOR = "x-wso2-request-interceptor"; public static final String X_WSO2_RESPONSE_INTERCEPTOR = "x-wso2-response-interceptor"; public static final String X_WSO2_ENDPOINT_TYPE = "type"; + public static final String ADVANCE_ENDPOINT_CONFIG = "advanceEndpointConfig"; + public static final String TIMEOUT_IN_MILLIS = "timeoutInMillis"; //API Constants public static final String API_DATA_NAME = "name"; diff --git a/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/definitions/OASParserUtil.java b/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/definitions/OASParserUtil.java index 356d591dce79..77f2ba94ad23 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/definitions/OASParserUtil.java +++ b/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/definitions/OASParserUtil.java @@ -1388,6 +1388,17 @@ private static ObjectNode setPrimaryConfig(JSONObject endpointConfig, boolean is ObjectNode endpointResult = objectMapper.createObjectNode(); endpointResult.set(APIConstants.ENDPOINT_URLS, endpointsArray); endpointResult.put(APIConstants.X_WSO2_ENDPOINT_TYPE, type); + if (primaryEndpoints.has(APIConstants.ADVANCE_ENDPOINT_CONFIG) + && primaryEndpoints.get(APIConstants.ADVANCE_ENDPOINT_CONFIG) != JSONObject.NULL) { + JSONObject advanceEndpointConfig = primaryEndpoints.getJSONObject(APIConstants.ADVANCE_ENDPOINT_CONFIG); + ObjectNode advanceEndpointsObject = objectMapper.createObjectNode(); + if (advanceEndpointConfig.has(APIConstants.TIMEOUT_IN_MILLIS) + && advanceEndpointConfig.get(APIConstants.TIMEOUT_IN_MILLIS) != JSONObject.NULL) { + advanceEndpointsObject.put(APIConstants.TIMEOUT_IN_MILLIS, + advanceEndpointConfig.getInt(APIConstants.TIMEOUT_IN_MILLIS)); + endpointResult.set(APIConstants.ADVANCE_ENDPOINT_CONFIG, advanceEndpointsObject); + } + } return endpointResult; } return null;