Raised This Month: $32 Target: $400
 8% 

[JSON] Invalid JSON value! 1


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
karaulov
Senior Member
Join Date: Jul 2018
Old 11-14-2021 , 06:15   [JSON] Invalid JSON value! 1
Reply With Quote #1

Code

Code:
new JSON: g_jObject = json_init_object();
json_object_set_value(g_jObject, "test", json_init_number(1), false);
json_free(g_jObject );
got error

L 11/14/2021 - 14:146: [JSON] Invalid JSON value! 1

How to fix ??(((

Installed latest master AMXMODX with modules and includes.
karaulov is offline
karaulov
Senior Member
Join Date: Jul 2018
Old 11-14-2021 , 06:25   Re: [JSON] Invalid JSON value! 1
Reply With Quote #2

Same error with (no error but value not written)
Code:
new JSON:tmpObj  = json_init_object();
json_object_set_number(tmpObj,key,1);
new JSON: g_jObject = json_init_object();
json_object_set_value(g_jObject, "test", tmpObj, false);
json_free(g_jObject );
json_free(tmpObj );
but with less often

Last edited by karaulov; 11-14-2021 at 06:36.
karaulov is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-14-2021 , 16:14   Re: [JSON] Invalid JSON value! 1
Reply With Quote #3

I've never used the JSON feature in AMX Mod X but maybe start with the json_test.sma plugin and make sure that that works and then base your code on that. This test plugin should in your files already in amxmodx/scripting/testsuite/json_test.sma.
__________________
fysiks is offline
GoodbayKOD
Junior Member
Join Date: Oct 2021
Old 11-14-2021 , 23:34   Re: [JSON] Invalid JSON value! 1
Reply With Quote #4

in the last amx update, the native:
PHP Code:
json_object_set_value 
gives errors. It is a bug in the update.

Last edited by GoodbayKOD; 11-14-2021 at 23:34.
GoodbayKOD is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-15-2021 , 22:06   Re: [JSON] Invalid JSON value! 1
Reply With Quote #5

Quote:
Originally Posted by GoodbayKOD View Post
in the last amx update, the native:
PHP Code:
json_object_set_value 
gives errors. It is a bug in the update.
What are you referring to as "the last amx update"?
__________________
fysiks is offline
GoodbayKOD
Junior Member
Join Date: Oct 2021
Old 11-16-2021 , 19:08   Re: [JSON] Invalid JSON value! 1
Reply With Quote #6

Quote:
Originally Posted by fysiks View Post
What are you referring to as "the last amx update"?
https://github.com/alliedmodders/amx...02066eb32493de
__________________
GoodbayKOD is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-16-2021 , 21:03   Re: [JSON] Invalid JSON value! 1
Reply With Quote #7

Quote:
Originally Posted by GoodbayKOD View Post
Just to clarify, is that the commit that broke it or the one that fixed it?
__________________
fysiks is offline
GoodbayKOD
Junior Member
Join Date: Oct 2021
Old 11-16-2021 , 21:44   Re: [JSON] Invalid JSON value! 1
Reply With Quote #8

Quote:
Originally Posted by fysiks View Post
Just to clarify, is that the commit that broke it or the one that fixed it?
if I'm not mistaken, that's exactly what happened.
__________________
GoodbayKOD is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-17-2021 , 00:04   Re: [JSON] Invalid JSON value! 1
Reply With Quote #9

Quote:
Originally Posted by GoodbayKOD View Post
if I'm not mistaken, that's exactly what happened.
That's not an answer to my question.
__________________
fysiks is offline
GoodbayKOD
Junior Member
Join Date: Oct 2021
Old 11-17-2021 , 05:20   Re: [JSON] Invalid JSON value! 1
Reply With Quote #10

Broke it...
__________________
GoodbayKOD is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:30.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode