Skip to content
Snippets Groups Projects
Commit 099f6265 authored by leehuwuj's avatar leehuwuj
Browse files

use urlparse for file path

parent 956538ee
Branches feat/add-openapi-tool
No related tags found
No related merge requests found
...@@ -50,7 +50,7 @@ class OpenAPIActionToolSpec(OpenAPIToolSpec, RequestsToolSpec): ...@@ -50,7 +50,7 @@ class OpenAPIActionToolSpec(OpenAPIToolSpec, RequestsToolSpec):
) )
spec = yaml.safe_load(response.text) spec = yaml.safe_load(response.text)
elif uri.startswith("file"): elif uri.startswith("file"):
filepath = uri[7:] # Remove the 'file://' scheme filepath = urlparse(uri).path
with open(filepath, "r") as file: with open(filepath, "r") as file:
spec = yaml.safe_load(file) spec = yaml.safe_load(file)
else: else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment