From c8b6a14ab92cc0494076f1024caa45ec485f3966 Mon Sep 17 00:00:00 2001 From: Suneth Samarasinghe Date: Fri, 14 Jul 2023 09:30:31 +0530 Subject: [PATCH] Fix for issue creating rest API using swagger definition FIxes https://github.com/wso2-enterprise/wso2-apim-internal/issues/3594 --- .../carbon/mediation/commons/rest/api/swagger/APIGenerator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/mediation-commons/src/main/java/org/wso2/carbon/mediation/commons/rest/api/swagger/APIGenerator.java b/components/mediation-commons/src/main/java/org/wso2/carbon/mediation/commons/rest/api/swagger/APIGenerator.java index f914b9d36f3..90e41421f7a 100644 --- a/components/mediation-commons/src/main/java/org/wso2/carbon/mediation/commons/rest/api/swagger/APIGenerator.java +++ b/components/mediation-commons/src/main/java/org/wso2/carbon/mediation/commons/rest/api/swagger/APIGenerator.java @@ -101,7 +101,7 @@ public API generateSynapseAPI() throws APIGenException { // url can be relative the place where the swagger is hosted. apiContext = serversString; } - if (apiContext.equals("/")) { + if (apiContext.isEmpty() || apiContext.equals("/")) { apiContext = SwaggerConstants.DEFAULT_CONTEXT; } //cleanup context : remove ending '/'