maahir22 commented on code in PR #30346:
URL: https://github.com/apache/airflow/pull/30346#discussion_r1151688713
##########
airflow/api_connexion/endpoints/request_dict.py:
##########
@@ -15,12 +15,13 @@
# specific language governing permissions and limitations
# under the License.
from __future__ import annotations
-
+from marshmallow import ValidationError
from typing import Any, Mapping, cast
def get_json_request_dict() -> Mapping[str, Any]:
"""Cast request dictionary to JSON."""
from flask import request
-
+ if request.data == b'':
+ raise ValidationError("POST Body must not be None")
Review Comment:
A) Yes this works, will change - much better than using hard-coded compare.
B) I was under the impression that BadRequest shouldn't be used inside
internal services and only in the handlers, but makes sense to use it because
it's in the api_connexion folder.
Will do all these changes, one last question the static run is failing, I
found the error but do I need to regenerate generated ts file too?
--
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]