Protojson marshaler wrong field type in nested message

Hi guys,

Please look at my message declaration. I have Avatar and NetworkEntityState message

When player join a match, i load Avatar from StorageEngine and send to client in a NetworkEntityState message. This is jsonValue of avatar

But in the log of Unity, the field type of object Avatar was changed from number to string. So an exception was threw

MatchStateJson [{"states":[{"id":"72a21b7a-380c-4b23-9ac6-abe12b4c5573", "username":"GSzGbaQbJB", "yPos":1, "state":"1", "avatar":{"hair":"6"}}]}]

Please help me to explain this issue.

It looks like int64 types are treated as strings by the specific marshaler you are using.

I found it. I followed template project and used protojson to encode and decode message.
I also changed it to proto, and now it’s worked.