Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grip_json_object_has_value don't work #155

Open
wopox1337 opened this issue Nov 23, 2019 · 1 comment
Open

grip_json_object_has_value don't work #155

wopox1337 opened this issue Nov 23, 2019 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@wopox1337
Copy link
Collaborator

#include <amxmodx>
#include <json>
#include <grip>

#pragma ctrlchar '\'
new const g_sJSON[] = "{  }";

public plugin_init()
{
///// TEST #1 (native JSON)
    new JSON:pObj = json_parse(g_sJSON);
    server_print(" [Method #1]: json_object_has_value():%i",
        json_object_has_value(pObj, "someKey")
    );

///// TEST #2 (GRip JSON)
    new sErrBuffer[128];
    new GripJSONValue:pObj1 = grip_json_parse_string(g_sJSON, sErrBuffer, charsmax(sErrBuffer));
    server_print(" [Method #2]: grip_json_object_has_value():%i",
        grip_json_object_has_value(pObj1, "someKey")
    );
}

image

@wopox1337
Copy link
Collaborator Author

but
image

will work

[Method #1]: json_object_has_value():1
[Method #2]: grip_json_object_has_value():1

@wopox1337 wopox1337 changed the title grip_json_object_has_value don't work [BUG] grip_json_object_has_value don't work Nov 23, 2019
@wopox1337 wopox1337 changed the title [BUG] grip_json_object_has_value don't work grip_json_object_has_value don't work Nov 23, 2019
@In-line In-line added bug Something isn't working good first issue Good for newcomers labels Nov 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants