I cannot figure out how to do a very, very simple thing for a web server to be able to do in Flask.
I would like to return an array in JSON format. Not rocket surgery here. But it seems that jsonify does not serlialize a list into JSON...? that's insane It seems like this code ought to work:
lists = List.query.all()
return jsonify(lists)
or at the very least allow me to wrap the list in a dictionary and return it.
lists = List.query.all()
return jsonify({"lists": lists})
But either of these returns
TypeError: Object of type List is not JSON serializable