It worked for the time being! But there seems to be a better way.
requirement.txt
#Excerpt
connexion==2.7.0
marshmallow-sqlalchemy==0.23.1
marshmallow==3.7.1
sqlalchemy==1.3.18
flask-marshmallow==0.13.0
flask-migrate==2.5.3
flask-sqlalchemy==2.4.4
flask==1.1.2
model.py
hoge_date = db.Column(db.Date(), nullable=False, default=date.fromisoformat('2099-12-31'))
console.log
marshmallow.exceptions.ValidationError: {'hoge_date': ['Field may not be null.']}
schema.py
class HogeSchema(ma.SQLAlchemyAutoSchema):
class Meta:
model = Hoge
#Add this
@pre_load
def remove_has_defalt_key_if_none(self, in_data: dict, **kwargs):
if in_data.get('hoge_date') is None:
in_data.pop('hoge_date', None)
return in_data