<filename>src/flask_coney/encoder.py
import json
from uuid import UUID


class UUIDEncoder(json.JSONEncoder):
    """Custom JSONEncoder to support UUID objects"""

    def default(self, obj):
        if isinstance(obj, UUID):
            # if the obj is uuid, we simply return the value of uuid
            return str(obj)
        return json.JSONEncoder.default(self, obj)

<filename>src/flask_coney/encoder.py
import json
from uuid import UUID


class UUIDEncoder(json.JSONEncoder):
    """Custom JSONEncoder to support UUID objects"""

    def default(self, obj):
        if isinstance(obj, UUID):
            # if the obj is uuid, we simply return the value of uuid
            return str(obj)
        return json.JSONEncoder.default(self, obj)

Custom JSONEncoder to support UUID objects # if the obj is uuid, we simply return the value of uuid