[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: luajson vs. null
- From: Alejandro Mery <amery@...>
- Date: Sat, 11 Sep 2010 13:56:14 +0200
On Sat, Sep 11, 2010 at 13:28, Alexander Gladysh <email@example.com> wrote:
> Hi, list!
> I wrote a small tool to convert JSON data to Lua (using luajson:
> However, there is a problem with nulls inside JSON data. The
> json.decode() inserts json.util.null() there, but, to get serializable
> output, I need Lua nils.
> I don't want to recursively traverse loaded data and replace nulls with nils.
> Is luajson author here? Can something be done? I suggest adding
> optional flag to json.decode().
if it would decode to `nil` you wouldn't be able to know about the
existance of that field at all, you need this json.util.null to
distinguish null data from no data