From e78de231837a95af73a57ec01d99bc7468877fe9 Mon Sep 17 00:00:00 2001 From: Dylan Anthony Date: Sat, 16 Oct 2021 21:16:18 -0600 Subject: [PATCH] chore: Fix relative path to spec (in this release, regression from #515) --- openapi_python_client/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi_python_client/__init__.py b/openapi_python_client/__init__.py index 85e83dbfd..af79badef 100644 --- a/openapi_python_client/__init__.py +++ b/openapi_python_client/__init__.py @@ -394,7 +394,7 @@ def _get_document(*, url: Optional[str], path: Optional[Path]) -> Union[Dict[str return GeneratorError(header="Could not get OpenAPI document from provided URL") elif path is not None: yaml_bytes = path.read_bytes() - content_type = mimetypes.guess_type(path.as_uri(), strict=True)[0] + content_type = mimetypes.guess_type(path.absolute().as_uri(), strict=True)[0] else: return GeneratorError(header="No URL or Path provided")