Braces in a JSON string cause VRCJson to fail deserialization
closed
TeaVirus
This was reported as fixed in 2024.4.1p3 but it looks like the problem crept back in and exists in SDK 3.8.2 / 2025.3.1 (haven't tested any other versions). Since the previous canny was closed out as complete, thought I'd open a new one.
Prior bug report on this issue:
// This works
if(VRCJson.TryDeserializeFromJson("\"{\"data\":\"test\"}", out DataToken token2))
Debug.LogError("Failed to deserialize JSON");
else
Debug.Log("Successfully deserialized JSON");
// This fails. Only difference is the braces after the word test in the JSON string. Number of braces or their configuration doesn't seem to make a difference.
if(VRCJson.TryDeserializeFromJson("{\"data\":\"test{}\"}", out DataToken token1))
Debug.LogError("Failed to deserialize JSON");
else
Debug.Log("Successfully deserialized JSON");
Thanks! -Tea
Log In
Dexvoid
updated the status to
closed
TeaVirus
Sigh... my repro was screwed up, sorry about that. The deserialization issue is fixed in 3.10.5-beta.1. Thank you!
Dexvoid
updated the status to
needs more information
TeaVirus Hi, unfortunately we cannot reproduce this issue in either
3.10.4
or in 3.10.5-beta.1
. In both of these SDK versions, deserialization seems to be succeeding for the JSON string {"data":"test{}"}
.Your sample above is logging an error when
TryDeserializeFromJson()
returns true, not when it returns false - the if check seems to be the wrong way round. Assuming that's the sample you ran for your most recent check, can you please double check if TryDeserializeFromJson()
is actually still returning false in 3.10.5-beta.1
?TeaVirus
It appears that this was listed as fixed in 3.10.5-beta.1 however it still appears to be broken. I ran my test case in a new worlds project with 3.10.5-beta.1 installed and the second test fails with: Failed to deserialize JSON
UnityEngine.Debug:LogError (object)
VRC.Udon.Wrapper.Modules.ExternUnityEngineDebug:__LogError__SystemObject__SystemVoid (VRC.Udon.Common.Interfaces.IUdonHeap,System.Span`1<uint>)
VRC.Udon.VM.UdonVM:Interpret ()
VRC.Udon.UdonBehaviour:RunProgram (uint) (at ./Packages/com.vrchat.worlds/Runtime/Udon/UdonBehaviour.cs:1157)
VRC.Udon.UdonBehaviour:RunEventAdvanced (string,bool) (at ./Packages/com.vrchat.worlds/Runtime/Udon/UdonBehaviour.cs:1373)
VRC.Udon.UdonBehaviour:RunEvent (string) (at ./Packages/com.vrchat.worlds/Runtime/Udon/UdonBehaviour.cs:1331)
VRC.Udon.UdonBehaviour:ManagedUpdate () (at ./Packages/com.vrchat.worlds/Runtime/Udon/UdonBehaviour.cs:593)
VRC.Udon.UdonManager:Update () (at ./Packages/com.vrchat.worlds/Runtime/Udon/UdonManager.cs:409)
syncpulse
Can someone please take a look at this? It is still broken in the latest client and SDK versions at time of writing
This post was marked as
tracked