abhishekbhakat commented on code in PR #49608:
URL: https://github.com/apache/airflow/pull/49608#discussion_r2057426378
##########
scripts/in_container/run_update_fastapi_api_spec.py:
##########
@@ -74,13 +76,29 @@ def generate_file(app: FastAPI, file_path: Path, prefix:
str = "", only_ui: bool
)
+def validate_openapi_file(file_path: Path) -> bool:
+ with file_path.open() as f:
+ openapi_schema = yaml.safe_load(f)
+ try:
+ validate_spec(openapi_schema)
+ except Exception as e:
+ print(f"[ERROR] OpenAPI validation failed for {file_path}: {e}",
file=sys.stderr)
+ return False
+ return True
Review Comment:
mypy enforces a return value so kept `return True` but exiting on exception.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]