diff --git a/files/OCI_API_Gateway_Automation_files.zip b/files/OCI_API_Gateway_Automation_files.zip index 136cec8..203e601 100644 Binary files a/files/OCI_API_Gateway_Automation_files.zip and b/files/OCI_API_Gateway_Automation_files.zip differ diff --git a/files/applyValidationApi/func.py b/files/applyValidationApi/func.py index d856b5f..836df40 100644 --- a/files/applyValidationApi/func.py +++ b/files/applyValidationApi/func.py @@ -467,17 +467,24 @@ def process_api_spec(api_id, compartmentId, environment, swagger, functionId, ho for spec in api_spec["routes"]: status = spec["backend"]["status"] specPath = spec["path"] - if (has_path_endpoint(endPointOrigin) and version == "3"): - endPoint = find_base_endpoint(endPointOrigin) - specPath = (find_base_pathendpoint(endPointOrigin, specPath) + spec["path"]).replace("//", "/") if (version == "3"): - fullEndpoint = (endPoint + find_base_path(specPath) + find_path(specPath)).replace("{", "${request.path[").replace("}", "]}") - FULL_PATH = specPath - ENDPOINT = fullEndpoint - PATH = find_path(specPath) - PATH_PREFIX = find_base_path(specPath) - METHOD = accMethods(api_spec["routes"], find_path(spec["path"]), status) + if (has_path_endpoint(endPointOrigin)): + endPoint = find_base_endpoint(endPointOrigin) + specPath = (find_base_pathendpoint(endPointOrigin, specPath)).replace("//", "/") + fullEndpoint = (endPoint + specPath + spec["path"]).replace("{", "${request.path[").replace("}", "]}") + FULL_PATH = specPath + ENDPOINT = fullEndpoint + PATH = spec["path"] + PATH_PREFIX = specPath + METHOD = accMethods(api_spec["routes"], find_path(spec["path"]), status) + else: + fullEndpoint = (endPoint + find_base_path(specPath) + find_path(specPath)).replace("{", "${request.path[").replace("}", "]}") + FULL_PATH = specPath + ENDPOINT = fullEndpoint + PATH = find_path(specPath) + PATH_PREFIX = find_base_path(specPath) + METHOD = accMethods(api_spec["routes"], find_path(spec["path"]), status) else: schemes = "" try: @@ -709,4 +716,4 @@ def handler(ctx, data: io.BytesIO = None): ctx, status_code=401, response_data=json.dumps({"active": False, "wwwAuthenticate": jsonData}) - ) + ) \ No newline at end of file