Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve advanceEndpointConfig when setting endpoint config #12151

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1388,6 +1388,17 @@
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();

Check warning on line 1394 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/definitions/OASParserUtil.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/definitions/OASParserUtil.java#L1393-L1394

Added lines #L1393 - L1394 were not covered by tests
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);

Check warning on line 1399 in components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/definitions/OASParserUtil.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/definitions/OASParserUtil.java#L1397-L1399

Added lines #L1397 - L1399 were not covered by tests
}
}
return endpointResult;
}
return null;
Expand Down
Loading