angelquirogam / nicejson Goto Github PK
View Code? Open in Web Editor NEWJSON library for C# (Pretty print, implicit operators, easy to read and write)
License: MIT License
JSON library for C# (Pretty print, implicit operators, easy to read and write)
License: MIT License
When a empty array is in the json string, this part of the parse will fail.
(Line 372 - 376) of NiceJson.json
private static JsonNode ParseJsonPart(string jsonPart)
{
JsonNode jsonPartValue = null;
switch (jsonPart[0])
{
How can I fix this warning?
''JsonObject.ContainsKey(string)' hides inherited member 'JsonNode.ContainsKey(string)'. Use the new keyword if hiding was intended. [Assembly-CSharp-firstpass]' at: '768,21' source: ''
Hi,
Great library; I'm trying to parse a JSON array in Unity3D using SimpleJSON, when I call this in my code
...
JsonArray response = (JsonArray)JsonNode.ParseJsonString(MyJsonString);
...
I get this error(goLevel.cs is the script I'm calling JsonNode.ParseJsonString from):
InvalidCastException: Cannot cast from source type to destination type.
goLevel+<WaitForRequest>c__Iterator0.MoveNext () (at Assets/_Scripts/goLevel.cs:99)
The content of MyJsonString is like:
"[{'platform': u'github', 'uri': u'https://github.com/habedi'}]\n"
Any suggestions to resolve this?
Thanks in advance.
Hassan
Hi, can you add Bigint support for lib?
Hi, first of all, thanks for this library. I've been writing my scripts with it now and one thing I've noticed that would be very useful, is to be able to do JsonObject[0], JsonObject[1], etc, instead of JsonObject["key1"], JsonObject["key2"].
I am just missing how to do this.. or is there a workaround for this?
This is my JSON and I want to do:
{
"name": "Forest Biome",
"multipliers":{
"steps": 1.00,
"xp_gain": 0.20,
"damage": 0.50
},
"tiles":{
"Forest Tile":{
"Hname": "forest_basic",
"rarity": 100,
"minHeight": 1,
"maxHeight": 1000
}
"Plains Tile":{
"Hname": "grass_basic",
"rarity": 50,
"minHeight": 1,
"maxHeight": 1000
}
}
}
and I was trying to do:
List<TileType> tiles = new List<TileType>();
//insert a loop to get every object listed in tiles {} later
tiles.Add(Tiles[json["tiles"][0]["Hname"]])
tiles.Add(Tiles[json["tiles"][1]["Hname"]]);
This worked fine; tiles.Add(Tiles[json["tiles"]["Forest Tile"]["Hname"]]);
Thanks,
Pixel
When there's a empty node "{}" in the code, S will be null and this code fails.
(Line 211) in NiceJson.json
protected static string UnescapeString(string s)
{
string result = string.Empty;
for (int i=0;i<s.Length;i++)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.