You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, been using this repo for a while in projects and it works a treat, I was looking at ways to check quickly if a JSON Node contains a key, and wasn't able to find a way to do that with your version - I tried the below script but there is no definition for node.Keys in your repo.
This works with the Bunny83 SimpleJSON latest version, but we ran into another issue with their version of SimpleJSON where checking if the JSON Node was null in an if statement always returned false even if the JSON was empty! Bunny83/SimpleJSON#45 - I have reported that issue to them there referencing your repo
So your version is great for checking if a JSON Node is null, but there is no way I could see to check quickly if a JSONNode contains a key with yours other than looping through the JSON Node by a section I defined and checking if values contain a string which feels slow - any tips?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace SimpleJSON
{
public class JSONNodeExtension : MonoBehaviour {
public static bool ContainsKey(SimpleJSON.JSONNode node, string checkKey)
{
foreach (string key in node.Keys)
{
if (key == checkKey)
return true;
}
return false;
}
}
}
Thanks for the great and robust version of SimpleJSON
The text was updated successfully, but these errors were encountered:
Hey, been using this repo for a while in projects and it works a treat, I was looking at ways to check quickly if a JSON Node contains a key, and wasn't able to find a way to do that with your version - I tried the below script but there is no definition for node.Keys in your repo.
This works with the Bunny83 SimpleJSON latest version, but we ran into another issue with their version of SimpleJSON where checking if the JSON Node was null in an if statement always returned false even if the JSON was empty! Bunny83/SimpleJSON#45 - I have reported that issue to them there referencing your repo
So your version is great for checking if a JSON Node is null, but there is no way I could see to check quickly if a JSONNode contains a key with yours other than looping through the JSON Node by a section I defined and checking if values contain a string which feels slow - any tips?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace SimpleJSON
{
public class JSONNodeExtension : MonoBehaviour {
}
Thanks for the great and robust version of SimpleJSON
The text was updated successfully, but these errors were encountered: