def generate_schema(primary_keys) ->object:
    """Generate singer schema for kafka messages

    MESSAGE_TIMESTAMP: Automatically will extract from kafka metadata
    MESSAGE: The original kafka message
    DYNAMIC_COLUMNS_FOR_PK: optional
    """
    schema = {'type': 'object', 'properties': {'message_timestamp': {'type':
        ['integer', 'string', 'null']}, 'message_offset': {'type': [
        'integer', 'null']}, 'message_partition': {'type': ['integer',
        'null']}, 'message': {'type': ['object', 'array', 'string', 'null']}}}
    for key in primary_keys:
        schema['properties'][key] = {'type': ['string', 'null']}
    return schema
