From 6e3b934790e6e710bf0235f3bbc787129274fdab Mon Sep 17 00:00:00 2001 From: hiranyakavishani Date: Wed, 18 Oct 2023 11:24:53 +0530 Subject: [PATCH] Setting isDefaultVersion true a new API Product. --- .../api/publisher/v1/common/mappings/PublisherCommonUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/main/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/common/mappings/PublisherCommonUtils.java b/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/main/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/common/mappings/PublisherCommonUtils.java index 237fdf077414..6a881b795309 100755 --- a/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/main/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/common/mappings/PublisherCommonUtils.java +++ b/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/main/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/common/mappings/PublisherCommonUtils.java @@ -1841,7 +1841,8 @@ public static APIProduct addAPIProductWithGeneratedSwaggerDefinition(APIProductD apiProductDTO.setApiKeyHeader(APIConstants.API_KEY_HEADER_DEFAULT); } - apiProductDTO.setIsDefaultVersion(false); + //isDefaultVersion is true for a new API Product. + apiProductDTO.setIsDefaultVersion(true); //Remove the /{version} from the context. if (context.endsWith("/" + RestApiConstants.API_VERSION_PARAM)) {