MagicOnion icon indicating copy to clipboard operation
MagicOnion copied to clipboard

Support Content Negotiation using the Content-Type: application/grpc+memorypack header

Open arontsang opened this issue 3 months ago • 3 comments

GRPC already specifies that you can switch serializers using the application/grpc+proto and the application/grpc+json content types.

arontsang avatar Sep 26 '25 16:09 arontsang

Does this mean you want support for dual mode with MessagePack and MemoryPack?

mayuki avatar Dec 04 '25 06:12 mayuki

Why not? Additionally, why not add protobuf for actual gRPC on top.

On Thu, 4 Dec 2025, 14:25 Mayuki Sawatari, @.***> wrote:

mayuki left a comment (Cysharp/MagicOnion#982) https://github.com/Cysharp/MagicOnion/issues/982#issuecomment-3610507402

Does this mean you want support for dual mode with MessagePack and MemoryPack?

— Reply to this email directly, view it on GitHub https://github.com/Cysharp/MagicOnion/issues/982#issuecomment-3610507402, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA46MLPBNEQPHO6YNXGGRH3377HVRAVCNFSM6AAAAACHTJLJRKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTMMJQGUYDONBQGI . You are receiving this because you authored the thread.Message ID: @.***>

arontsang avatar Dec 04 '25 06:12 arontsang

This relates to how ASP.NET Core handles endpoints and how grpc-dotnet handles methods.

ASP.NET Core does not support content negotiation within the same endpoint. grpc-dotnet also handles handler and marshaller (serialization) as a single Method unit. Therefore, it is also difficult to perform routing on the gRPC method handler side.

While using MapWhen might allow handling multiple endpoints, the current MagicOnion implementation does not support customizing serializers per endpoint.

mayuki avatar Dec 08 '25 06:12 mayuki