Closed abceleung closed 1 month ago
Answering one of my own question:
Turns out you need to install marshmallow-sqlalchemy
and flask-marshmallow
together, otherwise auto_field
will be missing.
That's right; marshmallow-sqlalchemy is an optional dep to flask-marshmallow, so you need to explicitly install it.
As far as using flask-marshmallow with flask-smorest: go for it! They occupy different areas of responsibility (flask-marshmallow for schema definition, flask-smorest for the view layer).
Hi, I have a Flask application with
Flask-SQLAlchemy
. I am confused by the relationship between the official plugins.I see that both
flask-marshmallow
andmarshmallow-sqlalchemy
offersSQLAlchemyAutoSchemaOpts
,SQLAlchemySchema
andSQLAlchemySchemaOpts
. These two libraries seems to be mostly overlapping in features. If I am usingFlask-SQLAlchemy
, I should useflask-marshmallow
instead ofmarshmallow-sqlalchemy
, correct?Also, I use
flask-smorest
for the automated OpenAPI spec generation. Doflask-smorest
andflask-marshmallow
work well together? Thanks.