from datetime import date

from aws_lambda_powertools.shared.json_encoder import Encoder


class JSONEncoder(Encoder):
    def default(self, obj):
        if isinstance(obj, date):
            return obj.isoformat()

        return super().default(obj)
