From 8cb730ff285f5db336c58c67f4975af64ffbe7a5 Mon Sep 17 00:00:00 2001 From: Ashan Rathnaweera Date: Thu, 12 Dec 2024 22:43:40 +0530 Subject: [PATCH] Set setResolveCombinators to false when parsing OpenAPI/Swagger definition (swagger string) into an OpenAPI object using the parsing option setResolveFully --- .../gateway/handlers/common/APIMgtLatencyStatsHandler.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/apimgt/org.wso2.carbon.apimgt.gateway/src/main/java/org/wso2/carbon/apimgt/gateway/handlers/common/APIMgtLatencyStatsHandler.java b/components/apimgt/org.wso2.carbon.apimgt.gateway/src/main/java/org/wso2/carbon/apimgt/gateway/handlers/common/APIMgtLatencyStatsHandler.java index 4b06dc73f491..7fb83493a898 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.gateway/src/main/java/org/wso2/carbon/apimgt/gateway/handlers/common/APIMgtLatencyStatsHandler.java +++ b/components/apimgt/org.wso2.carbon.apimgt.gateway/src/main/java/org/wso2/carbon/apimgt/gateway/handlers/common/APIMgtLatencyStatsHandler.java @@ -131,7 +131,9 @@ private void setSwaggerToMessageContext(MessageContext messageContext) { swagger = localEntryObj.getValue().toString(); OpenAPIParser parser = new OpenAPIParser(); ParseOptions parseOptions = new ParseOptions(); + parseOptions.setResolve(true); parseOptions.setResolveFully(true); + parseOptions.setResolveCombinators(false); openAPI = parser.readContents(swagger, null, parseOptions).getOpenAPI(); // HTTP headers should be case insensitive as for HTTP 1.1 RFC // Thus converting headers to lowercase for schema validation.