JsonConverter.DeserializeObject stuck forever

Using online JSON generator and coping the result to a text file appears to mess up the escape characters. using a C# application JsonSerializer and copy cause no issues…


Currently having a issue where the JsonConverter.DeserializeObject gets stuck forever when trying to deserialize a JSON containing a string[] where the values contain escape characters

This is a example that creates the issue
“files”: [\“1.tca\”,\“2.tca\”,\“3.tca\”]

I have created the InstanceFactory method to deal with the string[] but its never called when escape characters are present in the JSON.

Its correct assumed that its not usual for JSON to contain escape characters?

I guess a quick fix for this is cleaning the JSON before calling the deserializer but my biggest concern is that it is possibly get stuck in a loop.

I’ve actually never seen quotes escaped outside of a quoted string in JSON before. Probably not technically illegal, but because the quoting is not needed, the TinyCLR JSON parser doesn’t expect them and doesn’t handle them. Of course, it also doesn’t handle them within strings either (which it should).

Might just be me who have done something really weird but I do think I have seen this before in JSONs.

However my biggest concern is the serializer gets stuck in a loop where the watchdog would be the only option to save the day.

1 Like

Absolutely. Definitely a bug.