Flask 1.1.x supports returning a JSON dict without calling jsonify
. If you want to return something besides a dict, you still need to call jsonify
.
@app.route("/")
def index():
return {
"api_stuff": "values",
}
is equivalent to
@app.route("/")
def index():
return jsonify({
"api_stuff": "values",
})
See the pull request that added this: https://github.com/pallets/flask/pull/3111