Bunny83 / SimpleJSON

A simple JSON parser in C#
MIT License
735 stars 294 forks source link

JSON not parsed #49

Closed wearstudio closed 2 years ago

wearstudio commented 2 years ago

I have JSON

{"data":{"login":{"authentication":{"accessToken":"eyJhbGciOiJSUzI1"}}}}

SimpleJSON.JSON.Parse does not create child nodes. What could be the problem?

Bunny83 commented 2 years ago

What exactly do you mean? Given your json text you should be able to access your accessToken like this:

JSONNode n = JSON.Parse(yourJsonText);
string accessToken = n["data"]["login"]["authentication"]["accessToken"];

What exacly doesn't work? How do you use it or try to access the child nodes?

wearstudio commented 2 years ago

Sorry, it works, I didn't understand a bit.