Currently, there was some errors when a post request have no request body:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>400 Bad Request</title>\n<h1>Bad Request</h1>\n<p>Failed to decode JSON object: Expecting value: line 1 column 1 (char 0)</p><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>400 Bad Request</title>\n<h1>Bad Request</h1>\n<p>Failed to decode JSON object: Expecting value: line 1 column 1 (char 0)</p>
Hi @gwind,
Thank you for pointing out. Now there is an option to specify these params in validate's get_json_params parameter. It's included in the new version 0.9.0.
I saw that
get_json()
method have no any params in line: https://github.com/bauerji/flask_pydantic/blob/45987a2d4474b5c9423e057a66d98863468fa0bd/flask_pydantic/core.py#L176but the flask support some custom params, in doc: https://tedboy.github.io/flask/generated/generated/flask.Request.get_json.html
Currently, there was some errors when a post request have no request body: