You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "jason810496 (via GitHub)" <gi...@apache.org> on 2026/04/29 14:05:25 UTC

Re: [PR] Replaced manual response descriptions with create_openapi_http_exception_doc [airflow]

jason810496 commented on code in PR #62624:
URL: https://github.com/apache/airflow/pull/62624#discussion_r3161600525


##########
airflow-core/src/airflow/api_fastapi/execution_api/routes/task_instances.py:
##########
@@ -91,11 +92,13 @@
 @ti_id_router.patch(
     "/{task_instance_id}/run",
     status_code=status.HTTP_200_OK,
-    responses={
-        status.HTTP_404_NOT_FOUND: {"description": "Task Instance not found"},
-        status.HTTP_409_CONFLICT: {"description": "The TI is already in the requested state"},
-        HTTP_422_UNPROCESSABLE_CONTENT: {"description": "Invalid payload for the state transition"},
-    },
+    responses=create_openapi_http_exception_doc(

Review Comment:
   How about making `create_openapi_http_exception_doc` interface accept both `list[int]` or `list[tuple[int,str]]` (or having explictive NamedTuple). If it receive the later one, we can still add the description.



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org