I write application on Flask
. For RestAPI
I'm use flask-marshmallow
. But I get error.
The view function did not return a valid response. The return type must be a string, dict, tuple, Response instance, or WSGI callable, but it was a list. I do everything as in the example https://flask-marshmallow.readthedocs.io/en/latest/
class ApplicationSchema(ma.Schema):
class Meta:
fields = ("id", "name")
applications_schema = ApplicationSchema(many=True)
@bp.route("")
def applications():
all_applications = Application.query.all()
return applications_schema.dump(all_applications)