I use PluginContract.PlayFab_Serializer to serialize json but it also serializes properties as well. Is there anyway to ignore properties when serializing json using Playfab Serializer.
I use PluginContract.PlayFab_Serializer to serialize json but it also serializes properties as well. Is there anyway to ignore properties when serializing json using Playfab Serializer.
Could you please provide the specific example? How did you use the PluginContract.PlayFab_Serializer in the client? And what is the expected behavior? Could you please provide the corresponding code snippet?
I am having the same issue. There appears to be no way to stop the SimpleJSON serializer from including properties. The normal C# way of adding a [System.NonSerialized] can not be added to a property only a field.
public class AClass { public string ID = ""; public int[] Data = new int[10]; public int Property { get { return Data[0]; } set { Data[0] = value; } } }
Passing an instance of this class to say the ExecuteCloudScript as a dynamic property results in the basically the following JSON
["ID":"", "Data": [], "Property": 1]
Most serializers will not serialize properties without specifically including them. Looking at the SimpleJSON code I did not see any attributes to control this.
I would rather not have to make a separate class to copy to first before submitting.
Most of the point of this usage is to reduce the size of the actual json being sent. Be only serializing the the individual properties as a single json array of numbers.
I found ISerializer but this seem overkill to just exclude some properties that most other libraries have an attribute for.
Thanks
Jeremy
2 People are following this question.