Skip to content

Commit fa5d0df

Browse files
v1.2.1
1 parent 3f4a5c2 commit fa5d0df

File tree

3 files changed

+19
-14
lines changed

3 files changed

+19
-14
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.2.1] - 2025-07-30
9+
10+
- Added support for using the current working directory (CWD) as an option when
11+
handling OpenAPI links, by @joewlambeth.
12+
813
## [1.2.0] - 2025-04-27
914

1015
- Update objects to the OpenAPI Specification v3.1, by @tyzhnenko.

openapidocs/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
__version__ = "1.2.0"
1+
__version__ = "1.2.1"
22
VERSION = __version__

openapidocs/utils/source.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -76,23 +76,23 @@ def read_from_source(source: str, cwd: Path = None):
7676
potential_paths.append(cwd / source)
7777

7878
for source_path in potential_paths:
79-
if source_path.exists():
80-
if not source_path.is_file():
81-
raise ValueError("The given path is not a file path.")
79+
if source_path.exists():
80+
if not source_path.is_file():
81+
raise ValueError("The given path is not a file path.")
8282

83-
logger.debug("Reading from file %s", source)
83+
logger.debug("Reading from file %s", source)
8484

85-
file_path = source.lower()
85+
file_path = source.lower()
8686

87-
if file_path.endswith(".json"):
88-
return read_from_json_file(source_path)
87+
if file_path.endswith(".json"):
88+
return read_from_json_file(source_path)
8989

90-
if file_path.endswith(".yaml") or file_path.endswith(".yml"):
91-
return read_from_yaml_file(source_path)
92-
else:
93-
raise ValueError("Unsupported source file.")
94-
else:
95-
logger.debug("Path %s does not exist, trying next.", source)
90+
if file_path.endswith(".yaml") or file_path.endswith(".yml"):
91+
return read_from_yaml_file(source_path)
92+
else:
93+
raise ValueError("Unsupported source file.")
94+
else:
95+
logger.debug("Path %s does not exist, trying next.", source)
9696

9797
source_lower = source.lower()
9898

0 commit comments

Comments
 (0)