From 1c978952aa034f576ece88978d38a99668c13aac Mon Sep 17 00:00:00 2001 From: minuhin Date: Mon, 24 Aug 2020 13:07:43 +0300 Subject: [PATCH] don't copy spec to cache when it's a local file --- changelog.md | 4 ++++ foliant/preprocessors/swaggerdoc/swaggerdoc.py | 13 +++++++------ setup.py | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/changelog.md b/changelog.md index 4d468e3..ee04201 100755 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,7 @@ +# 1.2.3 + +- Fix: build failed when spec referenced to other files with $ref. + # 1.2.2 - Fix spec path issue. diff --git a/foliant/preprocessors/swaggerdoc/swaggerdoc.py b/foliant/preprocessors/swaggerdoc/swaggerdoc.py index aee7297..4462282 100644 --- a/foliant/preprocessors/swaggerdoc/swaggerdoc.py +++ b/foliant/preprocessors/swaggerdoc/swaggerdoc.py @@ -85,14 +85,15 @@ def _gather_specs(self, except (HTTPError, URLError) as e: self._warning(f'\nCannot retrieve swagger spec file from url {url}. Skipping.', error=e) - - if path_: - dest = self._swagger_tmp / f'swagger_spec' - if not Path(path_).exists(): + local_path = Path(path_) + if local_path: + # dest = self._swagger_tmp / f'swagger_spec' + if not local_path.exists(): self._warning(f"Can't find file {path_}. Skipping.") else: # file exists - copyfile(str(path_), str(dest)) - return dest + return local_path.resolve() + # copyfile(str(path_), str(dest)) + # return dest def _process_jinja(self, spec: PosixPath, diff --git a/setup.py b/setup.py index ccbec7b..be06aec 100755 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ description=SHORT_DESCRIPTION, long_description=LONG_DESCRIPTION, long_description_content_type='text/markdown', - version='1.2.2', + version='1.2.3', author='Daniil Minukhin', author_email='ddddsa@gmail.com', packages=['foliant.preprocessors.swaggerdoc'],