From dda95c2d8f9896dab46db02e67581ff9855db2f5 Mon Sep 17 00:00:00 2001 From: Viraj Date: Mon, 29 Apr 2019 16:07:13 +0530 Subject: [PATCH 1/2] fix the issue in codegenerator for import cmd --- .../wso2/apimgt/gateway/cli/codegen/CodeGenerator.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/micro-gateway-cli/src/main/java/org/wso2/apimgt/gateway/cli/codegen/CodeGenerator.java b/components/micro-gateway-cli/src/main/java/org/wso2/apimgt/gateway/cli/codegen/CodeGenerator.java index 5199676f52..88c063d830 100644 --- a/components/micro-gateway-cli/src/main/java/org/wso2/apimgt/gateway/cli/codegen/CodeGenerator.java +++ b/components/micro-gateway-cli/src/main/java/org/wso2/apimgt/gateway/cli/codegen/CodeGenerator.java @@ -77,17 +77,17 @@ public void generate(String projectName, List apis, boolean overwri OpenAPICodegenUtils.setAdditionalConfig(api); BallerinaService ballerinaService = new BallerinaService(); ballerinaService.setIsDevFirst(false); + definitionContext = ballerinaService.buildContext(openApi, api); // we need to generate the bal service for default versioned apis as well if (api.getIsDefaultVersion()) { - BallerinaService defaultDefinitionContext = ballerinaService.buildContext(openApi, api); - defaultDefinitionContext.setQualifiedServiceName(CodegenUtils.trim(api.getName())); - genFiles.add(generateService(defaultDefinitionContext)); + definitionContext.setQualifiedServiceName(CodegenUtils.trim(api.getName())); + genFiles.add(generateService(definitionContext)); // without building the definitionContext again we use the same context to build default version as // well. Hence setting the default version as false to generate the api with base path having version. api.setIsDefaultVersion(false); OpenAPICodegenUtils.setAdditionalConfig(api); + definitionContext.setQualifiedServiceName(CodegenUtils.trim(api.getName() + "_" + api.getVersion())); } - definitionContext = ballerinaService.buildContext(openApi, api); serviceList.add(definitionContext); genFiles.add(generateService(definitionContext)); genFiles.add(generateSwagger(definitionContext)); From dfde0eb7da519c4391831cd35dc67c291a816488 Mon Sep 17 00:00:00 2001 From: Hasunie Date: Mon, 29 Apr 2019 16:15:43 +0530 Subject: [PATCH 2/2] Fixes for test failure testRevokedTokenResponse --- .../gateway/services/token_revocation_event_listener.bal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/micro-gateway-core/src/main/ballerina/gateway/services/token_revocation_event_listener.bal b/components/micro-gateway-core/src/main/ballerina/gateway/services/token_revocation_event_listener.bal index 6299e41df0..a6db6bc739 100644 --- a/components/micro-gateway-core/src/main/ballerina/gateway/services/token_revocation_event_listener.bal +++ b/components/micro-gateway-core/src/main/ballerina/gateway/services/token_revocation_event_listener.bal @@ -27,7 +27,7 @@ string jmsConnectionProviderUrlTokenRevocation = getConfigValue(REALTIME_MESSAGE "amqp://admin:admin@carbon/carbon?brokerlist='tcp://localhost:5672'"); string jmsConnectionPasswordTokenRevocation = getConfigValue(REALTIME_MESSAGE_INSTANCE_ID, REALTIME_JMS_CONNECTION_PASSWORD, ""); string jmsConnectionUsernameTokenRevocation = getConfigValue(REALTIME_MESSAGE_INSTANCE_ID, REALTIME_JMS_CONNECTION_USERNAME, ""); -string tokenRevocationJMSTopic = getConfigValue(REALTIME_MESSAGE_INSTANCE_ID, REALTIME_JMS_CONNECTION_TOPIC, "tokenRevocation"); +string tokenRevocationJMSTopic = getConfigValue(REALTIME_MESSAGE_INSTANCE_ID, REALTIME_JMS_CONNECTION_TOPIC, "jwtRevocation"); service jmsTokenRevocationListener = service {