greyli · GitHub

This adds support to serializing list return values to JSON, like what we did for the dictionary:

@app.route('/')
def index():
    return ['this', 'will', 'become', 'JSON']

There are some discusses related to this feature in #3111, and the concern is the list return value looks too much like the tuple. Maybe we can rethink about this feature? I propose this because the following reasons:

If this change is acceptable, I will update the docs and changelog.

Sorry for break the "zero status". :P

Checklist:

  • Add tests that demonstrate the correct behavior of the change. Tests should fail without the change.
  • Add or update relevant docs, in the docs folder and in code.
  • Add an entry in CHANGES.rst summarizing the change and linking to the issue.
  • Add .. versionchanged:: entries in any relevant code docs.
  • Run pre-commit hooks and fix any issues.
  • Run pytest and tox, no tests failed.

Read the original on github.com ↗