Skip to content

Commit d65e658

Browse files
committed
Added another exception check
1 parent ba04e47 commit d65e658

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/openapi_python_generator/generate_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def get_open_api(path: Union[str,Path]) -> OpenAPI:
4545
raise ConnectError(f"Could not connect to {path}.")
4646
except (ValidationError,JSONDecodeError):
4747
typer.echo(f"File {path} is not a valid OpenAPI 3.0 specification, or there may be a problem with your JSON.")
48-
raise ValidationError(f"File {path} is not a valid OpenAPI 3.0 specification, or there may be a problem with your JSON.")
48+
raise
4949

5050

5151
def write_data(data: ConversionResult, output: str):

tests/test_generate_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def test_get_open_api(model_data):
1212
assert get_open_api(test_data_path) == model_data
1313

1414
with pytest.raises(ConnectError):
15-
assert get_open_api("http://test.com")
15+
assert get_open_api("http://localhost:8080/api/openapi.json")
1616

1717
with pytest.raises(ValidationError):
1818
assert get_open_api(test_data_folder / 'failing_api.json')

0 commit comments

Comments
 (0)