Andrushika commented on code in PR #69981:
URL: https://github.com/apache/airflow/pull/69981#discussion_r3603450488
##########
airflow-core/src/airflow/api_fastapi/execution_api/routes/task_instances.py:
##########
@@ -214,16 +214,14 @@ def ti_run(
previous_state=previous_state,
)
- # TODO: Pass a RFC 9457 compliant error message in "detail" field
- # https://datatracker.ietf.org/doc/html/rfc9457
- # to provide more information about the error
- # FastAPI will automatically convert this to a JSON response
- # This might be added in FastAPI in
https://github.com/fastapi/fastapi/issues/10370
raise HTTPException(
status_code=status.HTTP_409_CONFLICT,
detail={
+ "type": "about:blank",
+ "title": "Conflict",
+ "status": status.HTTP_409_CONFLICT,
+ "detail": "TI was not in a state where it could be marked as
running",
Review Comment:
This does not really match RFC 9457. It will create a nested response like
this:
(since `HTTPException` is used here)
```
{
"status_code": 409,
"detail": {
"type": "about:blank",
"title": "Conflict",
"status": 409,
"detail": "TI was not ..."
}
}
```
--
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]