pgjones
changed the title
WIP: Allow dictionaries return values as JSON
Allow dictionaries return values as JSON
This supports an increasingly common usecase whereby JSON is the
primary response (rather than a templated string). Given Flask has a
short syntax for HTML reponses, it seems fitting that it should also
do so for JSON responses. In practice it allows,
@app.route("/")
def index():
return {
"api_stuff": "values",
}
Merged
lafrech added a commit to marshmallow-code/flask-smorest that referenced this pull request
Sep 16, 2019Merged
Open
rtzll added a commit to rtzll/flask-todolist that referenced this pull request
Jul 17, 2020Since Flask 1.1.0 returning a dict will lead to responding with json by default. See: pallets/flask#3111
github-actions
Bot
locked as resolved and limited conversation to collaborators