import datetime
from typing import Optional


def json_serialize_datetime(dt : datetime.datetime) -> Optional[str]:
    """
    Serialize a datetime.datetime object into JSON (ISO format string).
    """
    if isinstance(dt, datetime.datetime):
        return dt.isoformat() + 'Z'
    return None