def json_serial(obj):
    """JSON serializer for objects not serializable by default json code
    >>> from datetime import date, datetime
    >>> json_serial(date(2018, 12, 12))
    '2018-12-12'
    >>> json_serial(datetime(2018, 12, 12, 12, 12))
    '2018-12-12T12:12:00'
    >>> json_serial("")
    Traceback (most recent call last):
        ...
    TypeError: Type <class 'str'> not serializable
    """
    try:
        return obj.isoformat()
    except AttributeError:
        raise TypeError("Type %s not serializable" % type(obj))