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..0f081dc103d 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() || "/".equals(apiContext)) { apiContext = SwaggerConstants.DEFAULT_CONTEXT; } //cleanup context : remove ending '/'