marshmallow-sqlalchemy
marshmallow-sqlalchemy copied to clipboard
Use with sqlalchemy-1.1 and JSON field type
If you use sqlalchemy 1.1 (b2 in my case) with the new JSON field type, you'll get a type conversion error:
marshmallow_sqlalchemy.exceptions.ModelConversionError: Could not find field column of type <class 'sqlalchemy.sql.sqltypes.JSON'>.
In Convert.py, I added ", sa.JSON: fields.Raw" to the end of SQLA_TYPE_MAPPING in class ModelConverter, and that seems to do the trick (at least so far)
Created a pull request for the change, modified the approach describe above a bit to avoid causing issues with versions of SQLAlchemy prior to 1.1. Tried to follow the contributions instructions, let me know what I missed.