File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
src/openapi_python_generator Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 33
44import httpx
55from httpx import ConnectError , ConnectTimeout
6- from orjson import orjson
6+ from orjson import orjson , JSONDecodeError
77import typer
88from pydantic import ValidationError
99import autopep8
@@ -43,9 +43,9 @@ def get_open_api(path: Union[str,Path]) -> OpenAPI:
4343 except (ConnectError ,ConnectTimeout ):
4444 typer .echo (f"Could not connect to { path } ." )
4545 raise ConnectError (f"Could not connect to { path } ." )
46- except ValidationError :
46+ 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
48+ raise ValidationError ( f"File { path } is not a valid OpenAPI 3.0 specification, or there may be a problem with your JSON." )
4949
5050
5151def write_data (data : ConversionResult , output : str ):
You can’t perform that action at this time.
0 commit comments