mirror of
https://github.com/hoshikawa2/OCI_API_Gateway_Automation2.git
synced 2026-03-06 02:10:36 +00:00
Correção: Não estava montando o path_prefix correto (obtendo apenas o 1o path) para a versão Swagger
This commit is contained in:
Binary file not shown.
@@ -467,17 +467,24 @@ def process_api_spec(api_id, compartmentId, environment, swagger, functionId, ho
|
|||||||
for spec in api_spec["routes"]:
|
for spec in api_spec["routes"]:
|
||||||
status = spec["backend"]["status"]
|
status = spec["backend"]["status"]
|
||||||
specPath = spec["path"]
|
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"):
|
if (version == "3"):
|
||||||
fullEndpoint = (endPoint + find_base_path(specPath) + find_path(specPath)).replace("{", "${request.path[").replace("}", "]}")
|
if (has_path_endpoint(endPointOrigin)):
|
||||||
FULL_PATH = specPath
|
endPoint = find_base_endpoint(endPointOrigin)
|
||||||
ENDPOINT = fullEndpoint
|
specPath = (find_base_pathendpoint(endPointOrigin, specPath)).replace("//", "/")
|
||||||
PATH = find_path(specPath)
|
fullEndpoint = (endPoint + specPath + spec["path"]).replace("{", "${request.path[").replace("}", "]}")
|
||||||
PATH_PREFIX = find_base_path(specPath)
|
FULL_PATH = specPath
|
||||||
METHOD = accMethods(api_spec["routes"], find_path(spec["path"]), status)
|
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:
|
else:
|
||||||
schemes = ""
|
schemes = ""
|
||||||
try:
|
try:
|
||||||
@@ -709,4 +716,4 @@ def handler(ctx, data: io.BytesIO = None):
|
|||||||
ctx,
|
ctx,
|
||||||
status_code=401,
|
status_code=401,
|
||||||
response_data=json.dumps({"active": False, "wwwAuthenticate": jsonData})
|
response_data=json.dumps({"active": False, "wwwAuthenticate": jsonData})
|
||||||
)
|
)
|
||||||
Reference in New Issue
Block a user