Nmap Development mailing list archives

Re: json library


From: Gorjan Petrovski <mogi57 () gmail com>
Date: Wed, 29 Jun 2011 16:01:17 +0200

I've looked into the json library and found that if it encounters a
NULL object, then it just returns string with a value "null", so that
would make the "{}" representation redundant.
Well JSON-wise, is there such a thing as a string representing a
nameless empty object when there is a definition for nil?
Has anyone ever encountered the use of "{}"?
If the answer to either of these questions is no, then we can make the
json library default to "[]" when it sees an empty table.

On the other hand if the "{}" is used more than "[]",  a hack has to
be used, and we should probably note this case in the NSEDoc.

Cheers,
Gorjan

On Wed, Jun 29, 2011 at 12:41 AM, Toni Ruottu <toni.ruottu () iki fi> wrote:
I am trying to use the json library to interact with a server that
uses json-rpc. The server expects me ot pass an empty argument list,
i.e. "[]". My problem is that json.generate({}) results in "{}", and
the server gives me an error for sending an object instead of an
array. Is this something we should fix in the json library, or should
I just come up with some kind of a hack?

 --Toni
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/




-- 
Gorjan
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: