Repository: wso2/micro-integrator
Issue: API - When the version-type of the synapse API is context, the url shown in dashboard does not work 

**Description:**
When the following API is deployed the URL shown in the Dashboard is `http://localhost:8290/v2/pet/1.0.5/findByStatus`. But the working URL is `http://localhost:8290/v2/pet/findByStatus`.

```
<?xml version="1.0" encoding="UTF-8"?>
<api context="/v2" name="Swagger Petstore" publishSwagger="/_system/governance/swagger_files/petStore.json" version="1.0.5" version-type="context" xmlns="http://ws.apache.org/ns/synapse">
    <resource methods="POST" uri-template="/pet/{petId}/uploadImage">
        <inSequence>
            <!--This is generated API skeleton.-->
            <property expression="get-property('uri.var.petId')" name="petId" scope="default" type="STRING"/>
            <!--Business Logic Goes Here-->
            <payloadFactory media-type="json">
                <format>{"Response" : "Sample Response"}</format>
                <args/>
            </payloadFactory>
            <loopback/>
        </inSequence>
        <outSequence>
            <respond/>
        </outSequence>
        <faultSequence/>
    </resource>
    <resource methods="POST" url-mapping="/pet">
        <inSequence>
            <!--This is generated API skeleton.-->
            <!--Business Logic Goes Here-->
            <payloadFactory media-type="json">
                <format>{"Response" : "Sample Response"}</format>
                <args/>
            </payloadFactory>
            <loopback/>
        </inSequence>
        <outSequence>
            <respond/>
        </outSequence>
        <faultSequence/>
    </resource>
    <resource methods="PUT" url-mapping="/pet">
        <inSequence>
            <!--This is generated API skeleton.-->
            <!--Business Logic Goes Here-->
            <payloadFactory media-type="json">
                <format>{"Response" : "Sample Response"}</format>
                <args/>
            </payloadFactory>
            <loopback/>
        </inSequence>
        <outSequence>
            <respond/>
        </outSequence>
        <faultSequence/>
    </resource>
    <resource methods="GET" url-mapping="/pet/findByStatus">
        <inSequence>
            <!--This is generated API skeleton.-->
            <!--Business Logic Goes Here-->
            <payloadFactory media-type="json">
                <format>{"Response" : "Sample Response"}</format>
                <args/>
            </payloadFactory>
            <loopback/>
        </inSequence>
        <outSequence>
            <respond/>
        </outSequence>
        <faultSequence/>
    </resource>
    <resource methods="GET" url-mapping="/pet/findByTags">
        <inSequence>
            <!--This is generated API skeleton.-->
            <!--Business Logic Goes Here-->
            <payloadFactory media-type="json">
                <format>{"Response" : "Sample Response"}</format>
                <args/>
            </payloadFactory>
            <loopback/>
        </inSequence>
        <outSequence>
            <respond/>
        </outSequence>
        <faultSequence/>
    </resource>
    <resource methods="GET" uri-template="/pet/{petId}">
        <inSequence>
            <!--This is generated API skeleton.-->
            <property expression="get-property('uri.var.petId')" name="petId" scope="default" type="STRING"/>
            <!--Business Logic Goes Here-->
            <payloadFactory media-type="json">
                <format>{"Response" : "Sample Response"}</format>
                <args/>
            </payloadFactory>
            <loopback/>
        </inSequence>
        <outSequence>
            <respond/>
        </outSequence>
        <faultSequence/>
    </resource>
    <resource methods="POST" uri-template="/pet/{petId}">
        <inSequence>
            <!--This is generated API skeleton.-->
            <property expression="get-property('uri.var.petId')" name="petId" scope="default" type="STRING"/>
            <!--Business Logic Goes Here-->
            <payloadFactory media-type="json">
                <format>{"Response" : "Sample Response"}</format>
                <args/>
            </payloadFactory>
            <loopback/>
        </inSequence>
        <outSequence>
            <respond/>
        </outSequence>
        <faultSequence/>
    </resource>
    <resource methods="DELETE" uri-template="/pet/{petId}">
        <inSequence>
            <!--This is generated API skeleton.-->
            <property expression="get-property('uri.var.petId')" name="petId" scope="default" type="STRING"/>
            <!--Business Logic Goes Here-->
            <payloadFactory media-type="json">
                <format>{"Response" : "Sample Response"}</format>
                <args/>
            </payloadFactory>
            <loopback/>
        </inSequence>
        <outSequence>
            <respond/>
        </outSequence>
        <faultSequence/>
    </resource>
    <resource methods="POST" url-mapping="/store/order">
        <inSequence>
            <!--This is generated API skeleton.-->
            <!--Business Logic Goes Here-->
            <payloadFactory media-type="json">
                <format>{"Response" : "Sample Response"}</format>
                <args/>
            </payloadFactory>
            <loopback/>
        </inSequence>
        <outSequence>
            <respond/>
        </outSequence>
        <faultSequence/>
    </resource>
    <resource methods="GET" uri-template="/store/order/{orderId}">
        <inSequence>
            <!--This is generated API skeleton.-->
            <property expression="get-property('uri.var.orderId')" name="orderId" scope="default" type="STRING"/>
            <!--Business Logic Goes Here-->
            <payloadFactory media-type="json">
                <format>{"Response" : "Sample Response"}</format>
                <args/>
            </payloadFactory>
            <loopback/>
        </inSequence>
        <outSequence>
            <respond/>
        </outSequence>
        <faultSequence/>
    </resource>
    <resource methods="DELETE" uri-template="/store/order/{orderId}">
        <inSequence>
            <!--This is generated API skeleton.-->
            <property expression="get-property('uri.var.orderId')" name="orderId" scope="default" type="STRING"/>
            <!--Business Logic Goes Here-->
            <payloadFactory media-type="json">
                <format>{"Response" : "Sample Response"}</format>
                <args/>
            </payloadFactory>
            <loopback/>
        </inSequence>
        <outSequence>
            <respond/>
        </outSequence>
        <faultSequence/>
    </resource>
    <resource methods="GET" url-mapping="/store/inventory">
        <inSequence>
            <!--This is generated API skeleton.-->
            <!--Business Logic Goes Here-->
            <payloadFactory media-type="json">
                <format>{"Response" : "Sample Response"}</format>
                <args/>
            </payloadFactory>
            <loopback/>
        </inSequence>
        <outSequence>
            <respond/>
        </outSequence>
        <faultSequence/>
    </resource>
    <resource methods="POST" url-mapping="/user/createWithArray">
        <inSequence>
            <!--This is generated API skeleton.-->
            <!--Business Logic Goes Here-->
            <payloadFactory media-type="json">
                <format>{"Response" : "Sample Response"}</format>
                <args/>
            </payloadFactory>
            <loopback/>
        </inSequence>
        <outSequence>
            <respond/>
        </outSequence>
        <faultSequence/>
    </resource>
    <resource methods="POST" url-mapping="/user/createWithList">
        <inSequence>
            <!--This is generated API skeleton.-->
            <!--Business Logic Goes Here-->
            <payloadFactory media-type="json">
                <format>{"Response" : "Sample Response"}</format>
                <args/>
            </payloadFactory>
            <loopback/>
        </inSequence>
        <outSequence>
            <respond/>
        </outSequence>
        <faultSequence/>
    </resource>
    <resource methods="GET" uri-template="/user/{username}">
        <inSequence>
            <!--This is generated API skeleton.-->
            <property expression="get-property('uri.var.username')" name="username" scope="default" type="STRING"/>
            <!--Business Logic Goes Here-->
            <payloadFactory media-type="json">
                <format>{"Response" : "Sample Response"}</format>
                <args/>
            </payloadFactory>
            <loopback/>
        </inSequence>
        <outSequence>
            <respond/>
        </outSequence>
        <faultSequence/>
    </resource>
    <resource methods="PUT" uri-template="/user/{username}">
        <inSequence>
            <!--This is generated API skeleton.-->
            <property expression="get-property('uri.var.username')" name="username" scope="default" type="STRING"/>
            <!--Business Logic Goes Here-->
            <payloadFactory media-type="json">
                <format>{"Response" : "Sample Response"}</format>
                <args/>
            </payloadFactory>
            <loopback/>
        </inSequence>
        <outSequence>
            <respond/>
        </outSequence>
        <faultSequence/>
    </resource>
    <resource methods="DELETE" uri-template="/user/{username}">
        <inSequence>
            <!--This is generated API skeleton.-->
            <property expression="get-property('uri.var.username')" name="username" scope="default" type="STRING"/>
            <!--Business Logic Goes Here-->
            <payloadFactory media-type="json">
                <format>{"Response" : "Sample Response"}</format>
                <args/>
            </payloadFactory>
            <loopback/>
        </inSequence>
        <outSequence>
            <respond/>
        </outSequence>
        <faultSequence/>
    </resource>
    <resource methods="GET" url-mapping="/user/login">
        <inSequence>
            <!--This is generated API skeleton.-->
            <!--Business Logic Goes Here-->
            <payloadFactory media-type="json">
                <format>{"Response" : "Sample Response"}</format>
                <args/>
            </payloadFactory>
            <loopback/>
        </inSequence>
        <outSequence>
            <respond/>
        </outSequence>
        <faultSequence/>
    </resource>
    <resource methods="GET" url-mapping="/user/logout">
        <inSequence>
            <!--This is generated API skeleton.-->
            <!--Business Logic Goes Here-->
            <payloadFactory media-type="json">
                <format>{"Response" : "Sample Response"}</format>
                <args/>
            </payloadFactory>
            <loopback/>
        </inSequence>
        <outSequence>
            <respond/>
        </outSequence>
        <faultSequence/>
    </resource>
    <resource methods="POST" url-mapping="/user">
        <inSequence>
            <!--This is generated API skeleton.-->
            <!--Business Logic Goes Here-->
            <payloadFactory media-type="json">
                <format>{"Response" : "Sample Response"}</format>
                <args/>
            </payloadFactory>
            <loopback/>
        </inSequence>
        <outSequence>
            <respond/>
        </outSequence>
        <faultSequence/>
    </resource>
</api>

```

**Steps to reproduce:**
1. Create a Synapse API importing the following swagger definition.
[petStore.zip](https://github.com/wso2/micro-integrator/files/4986905/petStore.zip)
2. Deploy it.
3. In the Dashboard, the URL will be shown as this `http://localhost:8290/v2/pet/1.0.5/findByStatus`.
4. But the working URL is `http://localhost:8290/v2/pet/findByStatus`.

Changed files:
components/org.wso2.micro.integrator.extensions/org.wso2.micro.integrator.management.apis/src/main/java/org/wso2/micro/integrator/management/apis/ApiResource.java

diff --git a/components/org.wso2.micro.integrator.extensions/org.wso2.micro.integrator.management.apis/src/main/java/org/wso2/micro/integrator/management/apis/ApiResource.java b/components/org.wso2.micro.integrator.extensions/org.wso2.micro.integrator.management.apis/src/main/java/org/wso2/micro/integrator/management/apis/ApiResource.java
index a91067a34..ce8cffcae 100644
--- a/components/org.wso2.micro.integrator.extensions/org.wso2.micro.integrator.management.apis/src/main/java/org/wso2/micro/integrator/management/apis/ApiResource.java
+++ b/components/org.wso2.micro.integrator.extensions/org.wso2.micro.integrator.management.apis/src/main/java/org/wso2/micro/integrator/management/apis/ApiResource.java
@@ -53,6 +53,7 @@ public class ApiResource extends APIResource {
     private static Log LOG = LogFactory.getLog(ApiResource.class);
 
     private static final String API_NAME = "apiName";
+    private static final String URL_VERSION_TYPE = "url";
     private String serverContext = "";  // base server url
 
     public ApiResource(String urlTemplate) {
@@ -215,7 +216,7 @@ public class ApiResource extends APIResource {
         org.apache.axis2.context.MessageContext axisMsgCtx = ((Axis2MessageContext) msgCtx).getAxis2MessageContext();
         String serverUrl = getServerContext(axisMsgCtx.getConfigurationContext().getAxisConfiguration());
         String versionUrl = "";
-        if (!api.getVersion().isEmpty()) {
+        if (URL_VERSION_TYPE.equals(api.getVersionStrategy().getVersionType()) && !api.getVersion().isEmpty()) {
             versionUrl = "/" + api.getVersion();
         }
         return serverUrl.equals("err") ? api.getContext() : serverUrl + api.getContext() + versionUrl;