Skip to content

Commit

Permalink
Check for absolute paths provided in the argument (#231)
Browse files Browse the repository at this point in the history
  • Loading branch information
fhalde authored May 1, 2024
1 parent 3fcad9c commit 0a0b17a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion json_schema_for_humans/schema/schema_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def _get_schema_paths(schema_file_or_dir: Union[str, Path]) -> List[Path]:
if isinstance(schema_file_or_dir, str):
schema_file_or_dir = Path(schema_file_or_dir)

if schema_file_or_dir.is_file():
if schema_file_or_dir.is_file() or (schema_file_or_dir.is_absolute() and not schema_file_or_dir.is_dir()):
schema_file_paths.append(schema_file_or_dir)
elif schema_file_or_dir.is_dir():
for glob_pattern in ["**/*.json", "**/*.yaml", "**/*.yml"]:
Expand Down

0 comments on commit 0a0b17a

Please sign in to comment.