do_genValue: received YAJL generator status 4 for type code 1

Discussions relating to the ScottKlement.com port of the open source YAJL JSON Reader/Generator. This includes the YAJL tool as well as the YAJLR4, YAJLGEN, YAJLINTO and YAJLDTAGEN add-ons from ScottKlement.com. http://www.scottklement.com/yajl/
Post Reply
MelanieJ
Posts: 2
Joined: Wed Jul 27, 2022 9:16 am

do_genValue: received YAJL generator status 4 for type code 1

Post by MelanieJ »

Hello,

I can not find the solution of my issue using YAJL.

Could you help ?
In the buffer of YAJL, I can only see the first line (beginObj line). nothing else.

In my program, I do basically :

yajl_genOpen(*off);
yajl_beginObj('');
yajl_addChar('nb': %char(nb_res));
yajl_addChar('result_msg': %trim(result_msg));
yajl_endObj();
str = YAJL_CopyBufStr();
yajl_genClose();

str contains only "".

I can see this information message in the job log :
do_genValue: received YAJL generator status 4 for type code 1

To be noted : my program is called by a ws program.
This ws program has done earlier :
DATA-INTO request %DATA(%trim(json)
: 'doc=string case=convert allowmissing=yes')
%PARSER('YAJLINTO');

but I think there is no need to close anything after the DATA-INTO...

Weirdly, I do not get any issue with very other similar programs.

Many thanks,
Mélanie
MelanieJ
Posts: 2
Joined: Wed Jul 27, 2022 9:16 am

Re: do_genValue: received YAJL generator status 4 for type code 1

Post by MelanieJ »

I have found the solution.

I had written : yajl_beginObj(''); to create an object with no name... but it should be without quotes like :

yajl_beginObj();

Thanks all for reading,
Mélanie
Post Reply