Git Product home page Git Product logo

nicejson's People

Contributors

angelquirogam avatar raysangar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

nicejson's Issues

Contains warning

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: ''

Casting Exception

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

Using index instead of key with JsonObject

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

Problem when S is null, occurs when a node is empty

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++)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.