-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed to decode JSON object: Expecting value: line 1 column 1 (char 0) - Werkzeug .2.1.x #2386
Comments
I can't reproduce this issue with the information provided. |
Attaching the example project. I'm reproducing the issue just by switching between versions 2.0.3 to 2.1.1. I also had next observation: Version 2.0.3
And the response on the client's side is: Version 2.1.1
# Extremely simple flask application
from flask import Flask
from flask_parameter_validation import ValidateParameters
app = Flask(__name__)
@app.route("/test", methods=['GET'])
@ValidateParameters()
def test():
app.logger.info('Test reached')
return 'Hello, world'
# When running the app directly through the Python command (use app.logger)
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5001, debug=True) I hope this will help |
I still can't reproduce, sending valid json is decoded correctly with the example provided. |
Wait, what do you mean by sending valid JSON? This is @app.route("/test", methods=['GET']) Maybe this is the problem, that Werkzeug is expecting some json in the request which is not right behavior. |
I'm encountering this error since version 2.1.x.
All I do is to call
GET HTTP://localhost:5000/api/some/path
, with an empty body and no parameters in the request.This is the curl request:
With Werkzeug version 2.0.3 everything is running fine, no errors and the response is 200
Environment:
The text was updated successfully, but these errors were encountered: