jsonfx

Unity Json De/serializing nested data [duplicate]

主宰稳场 提交于 2021-02-10 14:19:16
问题 This question already has answers here : Serialize and Deserialize Json and Json Array in Unity (9 answers) Closed 3 years ago . please help me! I'm trying to read a big chunk of data from a json file and most part of the data is a list of list! I dont know how to deserialize it! So I found this guide, and did as him using the JsonFX http://www.raybarrera.com/2014/05/18/json-deserialization-using-unity-and-jsonfx/ it helped me deserialize all the other information I need except the list of

ASP.NET MVC Read Raw JSON Post Data

时光总嘲笑我的痴心妄想 提交于 2019-12-17 18:17:30
问题 This is driving me crazy. I'm using ASP.NET MVC. I have a controller with an HttpPost action that acts as a callback URL that is called by another server (not under my control). I want to dynamically read JSON posted to it without using WebAPI or Model Binding. The URL also has a query string parameter passed to it. The callback URL looks something like this: http://domain.com/callback?secret=1234 I've tried reading the posted input using: [HttpPost] public ActionResult Callback( String

How to deserialize polymorphic collections in JsonFX?

孤街醉人 提交于 2019-12-11 14:49:23
问题 My JsonFX serialization code works, but the object that I'm serializing contains a list of polymorphic entities, and they're all deserialized as their base type and not their actual type. Here's my serialization code: public static string Serialize(System.Object obj) { StringBuilder builder = new StringBuilder(); using (TextWriter textWriter = new StringWriter(builder)) { JsonWriter writer = new JsonWriter(textWriter); writer.Write(obj); return builder.ToString(); } } public static T

Read JSON string as key value

谁说我不能喝 提交于 2019-12-09 06:41:52
问题 I have following json: { "serverTime": "2013-08-12 02:45:55,558", "data": [ { "key1": 1, "key2": {}, "key3": { "key4": [ "" ], "key5": "test2" }, "key7": 0 }, { "key8": 1, "key9": {}, "key10": { "key4": [ "" ], "key9": "test2" }, "key11": 0 } ] } I want to get values as key value pair. Something like: jsonObject[data][0] should give first item of the data array. I am using JSONFx.net. But it gives strongly typed objects. I do not want that. Is there any way to parse JSON as key value as I

Read JSON string as key value

限于喜欢 提交于 2019-12-03 08:37:12
I have following json: { "serverTime": "2013-08-12 02:45:55,558", "data": [ { "key1": 1, "key2": {}, "key3": { "key4": [ "" ], "key5": "test2" }, "key7": 0 }, { "key8": 1, "key9": {}, "key10": { "key4": [ "" ], "key9": "test2" }, "key11": 0 } ] } I want to get values as key value pair. Something like: jsonObject[data][0] should give first item of the data array. I am using JSONFx.net. But it gives strongly typed objects. I do not want that. Is there any way to parse JSON as key value as I mentioned earlier? Thanks Try this: using System; using System.IO; using Newtonsoft.Json; class Program {

ASP.NET MVC Read Raw JSON Post Data

不羁的心 提交于 2019-11-28 06:47:41
This is driving me crazy. I'm using ASP.NET MVC. I have a controller with an HttpPost action that acts as a callback URL that is called by another server (not under my control). I want to dynamically read JSON posted to it without using WebAPI or Model Binding. The URL also has a query string parameter passed to it. The callback URL looks something like this: http://domain.com/callback?secret=1234 I've tried reading the posted input using: [HttpPost] public ActionResult Callback( String secret ) { String jsonData = new StreamReader(this.Request.InputStream).ReadToEnd(); // ... } However