maahir22 opened a new pull request, #30346:
URL: https://github.com/apache/airflow/pull/30346
This PR closes #26424
Problem Statement: The POST Request to the endpoint
/api/v1/dags/~/dagRuns/~/taskInstances/list returns an unhelpful error ->
"detail": "None is not of type 'object'", when the JSON Body is empty. Upon
further inspection, it seems that this error is raised by vaildation.py and is
not handled properly leading to a generic error message and a Python Exception
inside the logs.
Fix: Allowing the request payload to be nullable and then checking if the
data in the request is None before parsing it into JSON -> allows us to handle
this error gracefully and even check for other unhandled cases.
New Response:
{
"detail": "['POST Body must not be None']",
"status": 400,
"title": "Bad Request",
"type":
"http://apache-airflow-docs.s3-website.eu-central-1.amazonaws.com/docs/apache-airflow/latest/stable-rest-api-ref.html#section/Errors/BadRequest"
}
Old Response:
{
"detail": "None is not of type 'object'",
"status": 400,
"title": "Bad Request",
"type":
"http://apache-airflow-docs.s3-website.eu-central-1.amazonaws.com/docs/apache-airflow/latest/stable-rest-api-ref.html#section/Errors/BadRequest"
}
Old Logs:
2023-03-28T17:16:17.637+0000 validation.py[200] None is not type object
--
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]