using System.Text;
using Confluent.Kafka;
using Newtonsoft.Json;
using JsonSerializer = System.Text.Json.JsonSerializer;

namespace Kafka.Lib.Unity;

public class MessageTypeSerializer<T> : ISerializer<T>
    where T : IMessageType
{
    public byte[] Serialize(T data, SerializationContext context)
    {
        var returnByte = JsonSerializer.SerializeToUtf8Bytes(data);

        return returnByte;
    }
}