From cc487079a861ee5c7e03be118eb67a30156589cc Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Tue, 19 Sep 2023 11:00:24 -0600 Subject: [PATCH] Allow applying `[MessagePackFormatter]` on parameters and return values This enables RPC libraries such as StreamJsonRpc to support this attribute being applied to RPC methods directly and invoking the correct formatter in such cases. --- .../Assets/Scripts/MessagePack/Annotations/Attributes.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Annotations/Attributes.cs b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Annotations/Attributes.cs index 227872199..a90a17b69 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Annotations/Attributes.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Annotations/Attributes.cs @@ -83,7 +83,7 @@ public class SerializationConstructorAttribute : Attribute { } - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface | AttributeTargets.Enum | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = true)] + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface | AttributeTargets.Enum | AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = false, Inherited = true)] public class MessagePackFormatterAttribute : Attribute { public Type FormatterType { get; private set; }