Skip to content
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
6 changes: 3 additions & 3 deletions ballerina/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "data.jsondata"
version = "1.1.0"
version = "1.1.1"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "lang.object"}
Expand All @@ -73,7 +73,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "http"
version = "2.14.0"
version = "2.14.4"
dependencies = [
{org = "ballerina", name = "auth"},
{org = "ballerina", name = "cache"},
Expand Down Expand Up @@ -240,7 +240,7 @@ modules = [
[[package]]
org = "ballerina"
name = "oauth2"
version = "2.14.0"
version = "2.14.1"
dependencies = [
{org = "ballerina", name = "cache"},
{org = "ballerina", name = "crypto"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Objects;

import static io.ballerina.wso2.apim.catalog.utils.Constants.BALLERINA;
import static io.ballerina.wso2.apim.catalog.utils.Constants.HTTP_PACKAGE_NAME;
import static io.ballerina.wso2.apim.catalog.utils.Constants.SLASH;
import static io.ballerina.wso2.apim.catalog.utils.Utils.createMd5Hash;
import static io.ballerina.wso2.apim.catalog.utils.Utils.generateBasePath;
import static io.ballerina.wso2.apim.catalog.utils.Utils.getDefinitionType;
Expand Down Expand Up @@ -178,10 +180,12 @@ private static void updateServiceName(BMap<BString, Object> artifactValues, Http
}

private static void updateServiceUrl(BMap<BString, Object> artifactValues, HttpServiceConfig httpServiceConfig) {
String basePath = httpServiceConfig.basePath.equals(LOCALHOST) ? "" : httpServiceConfig.basePath;
String basePathConfig = httpServiceConfig.basePath;
String basePath = basePathConfig.equals(SLASH) ? "" : basePathConfig;
boolean isLocalHost = Objects.equals(httpServiceConfig.host, LOCALHOST);
artifactValues.put(StringUtils.fromString(SERVICE_URL),
StringUtils.fromString(httpServiceConfig.host +
COLON + httpServiceConfig.port + basePath));
(isLocalHost ? (COLON + httpServiceConfig.port) : "") + basePath));
artifactValues.put(StringUtils.fromString(DEFINITION_URL),
StringUtils.fromString(httpServiceConfig.definitionUrl));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public final class Constants {
public static final String HTTP_MODULE_NAME = "ballerina/http";
public static final String HTTP_ANNOTATION_NAME = "ServiceConfig";
public static final String HOST = "host";
public static final String LOCALHOST = "localhost";
public static final String LOCALHOST = "http://localhost";
public static final String PORT = "port";
public static final String OAS3 = "OAS3";
public static final String BASIC = "BASIC";
Expand Down
Loading