Questions tagged [litjson]

LitJSON is a small and fast library for handling data in the JSON format. It is written in C# and is compatible with all .Net languages.

LitJSON is a small and fast library for handling data in the JSON format. It is written in C# and is compatible with all .Net languages.

37 questions
0
votes
1 answer

Unity LitJson.JsonData exception on cast in foreach loop

I got the following exception in the foreach statement of my code snippet below: exception:System.InvalidCastException: Cannot cast from source type to destination type. I took a closer look at LitJson.JsonData. It does have the internal class…
docchang
  • 1,115
  • 15
  • 32
0
votes
1 answer

Working with LitJson in C# in Unity

I am trying to port a piece of Code from Java to C# and I am stuck in JSon parsing. Have a look at the following Java Code mJsonObject = new JSONObject(str); Iterator keys=mJsonObject.keys(); while(keys.hasNext()){ …
Jawad Amjad
  • 2,532
  • 2
  • 29
  • 59
0
votes
2 answers

Deserializing JSON with different object types

I have a json with structure like this: { "result": [ {"a":{"b":1,"c":2}}, {"a":{"b":1,"c":2}}, {"a":{"b":1,"c":2}}, {"a":[]} ] } So I created class structure to parse this into C# objects: public class JsonTest { …
arazect
  • 13
  • 1
  • 3
0
votes
1 answer

LitJson: How can I convert Json to an specific object by casting it through reflection in C#?

I have a json string that has multiple class types. I want to be able to parse the json file and also cast the objects dynamically. Example: object jsonInstanceOfObject = LitJson.JsonMapper.ToObject(jsonString); Is…
Djokovic
  • 971
  • 2
  • 8
  • 13
0
votes
1 answer

LitJSON error in powershell

I'm trying to use Leonardo B's litjson library from PowerShell. The entry point to the library I need to use is a static method. I can load the assembly with add-type, no problem. Trying to use the static method though gives this error: PS…
Segfault
  • 8,036
  • 3
  • 35
  • 54
-1
votes
2 answers

Unity : Assign json to List

Below JSON is WWW GET result { "status":200, "watchlist":[ { "Category":"Movie", "ShowList":[ { "id":"59534a851339762f38e16ad7", "Name":"Play zombie…
FeelRightz
  • 2,777
  • 2
  • 38
  • 73
-2
votes
1 answer

Parsing JSON from API URL in Unity via C#

I am trying to parse some data that is in a JSON Array so that I can use it in my project. The values are used in plotting functions for visualizing orbits, I have completed literally everything for the project besides this task. To do the parse the…
1 2
3