I have a flask_restful API set up but want users to pass numpy arrays when making a post call. I first tried using reqparse
from flask_restful but it doesn't support data types of numpy.array. I am trying to use marshmallow (flask_marshmallow) but am having trouble understanding how the arguments get passed to the API.
Before I was able to do something like:
from flask_restful import reqparse
parser = reqparse.RequestParser()
parser.add_argument('url', type=str)
parser.add_argument('id', type=str, required=True)
But now I am not sure how to translate that into marshmallow. I have this set up:
from flask_marshmallow import Marshmallow
app = Flask(__name__)
ma = Marshmallow(app)
class MySchema(ma.Schema):
id = fields.String(required=True)
url = fields.String()
But how can I load in what a user passes in when making a call by using my newly defined schema?