python-restx / flask-restx

Fork of Flask-RESTPlus: Fully featured framework for fast, easy and documented API development with Flask
https://flask-restx.readthedocs.io/en/latest/
Other
2.14k stars 333 forks source link

Provide feedback for improvement #580

Open hf3344 opened 9 months ago

hf3344 commented 9 months ago

In the parse_args function in reqparse.py, there is a code snippet that concatenates a hardcoded value:

if errors:
    abort(
        HTTPStatus.BAD_REQUEST, "Input payload validation failed", errors=errors
    )

This concatenation occurs when input payload validation fails due to missing required parameters. However, the resulting error message does not reflect the desired help message. The untranslated Chinese error message is as follows:

{
    "errors": {
        "hello": "Missing required parameter in the JSON body or the post body or the query string"
    },
    "message": "Input payload validation failed"
}

I understand that this is causing confusion and inconvenience for you. To address this, you can modify the code to provide a more meaningful error message.