From bf1febc7d07f5bb6811a7a526533d9030a3edbe4 Mon Sep 17 00:00:00 2001 From: Tharsanan1 Date: Wed, 9 Oct 2024 12:16:25 +0530 Subject: [PATCH] Fix dp to cp flow for normal APIs --- apim-apk-agent/pkg/managementserver/rest_server.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apim-apk-agent/pkg/managementserver/rest_server.go b/apim-apk-agent/pkg/managementserver/rest_server.go index 7aad8f3d..1c349e4f 100644 --- a/apim-apk-agent/pkg/managementserver/rest_server.go +++ b/apim-apk-agent/pkg/managementserver/rest_server.go @@ -209,9 +209,11 @@ func createAPIYaml(apiCPEvent *APICPEvent) (string, string) { "authorizationHeader": authHeader, "apiKeyHeader": apiKeyHeader, "scopes": scopes, - "aiConfiguration": aiConfiguration, }, } + if len(aiConfiguration) > 0 { + data["data"].(map[string]interface{})["aiConfiguration"] = aiConfiguration + } // TODO when we start to process sandbox we need to have this if condition. For now we remove sandbox endpoint always. // if apiCPEvent.API.SandEndpoint == "" { delete(data["data"].(map[string]interface{})["endpointConfig"].(map[string]interface{}), "sandbox_endpoints")