Closed GoogleCodeExporter closed 8 years ago
It's so that you can distinguish between a 0-element array and an object with
no properties.
Original comment by bob.ippo...@gmail.com
on 7 Jun 2010 at 2:43
Ahh of course. A shame that the two mongodb drivers use the opposite solution
([{_,_},..] = object and {array,[...]}). Would you guys be willing to have the
json_encode function be more permissible?
json_encode([{_,_}|_] = Props, State) ->
json_encode_proplist(Props, State);
json_encode({struct, Props}, State) when is_list(Props) ->
json_encode_proplist(Props, State);
json_encode(Array, State) when is_list(Array) ->
json_encode_array(Array, State);
json_encode({array, Array}, State) when is_list(Array) ->
json_encode_array({array,Array}, State);
Original comment by rap...@gmail.com
on 7 Jun 2010 at 3:15
If you submit a patch with passing tests then I'll take a look at adding it
Original comment by bob.ippo...@gmail.com
on 7 Jun 2010 at 3:18
Patch attached. I added encoding tests for objects without struct tuple.
Original comment by rap...@gmail.com
on 7 Jun 2010 at 3:45
Attachments:
http://github.com/mochi/mochiweb/commit/c1c9431
Original comment by bob.ippo...@gmail.com
on 23 Jul 2010 at 9:54
After using my patch in multiple projects and testing with many possible json
document combinations, I since found one bug. Patch attached. It's a very
change simple.
I'm sorry for posting it so late, I forgot and the issue email reminded me.
Original comment by rap...@gmail.com
on 24 Jul 2010 at 7:33
Attachments:
After using my patch in multiple projects and testing with many possible json
document combinations, I since found one bug. Patch attached. It's a very
change simple.
I'm sorry for posting it so late, I forgot and the issue email reminded me.
Original comment by rap...@gmail.com
on 24 Jul 2010 at 7:34
Attachments:
After using my patch in multiple projects and testing with many possible json
document combinations, I since found one bug. Patch attached. It's a very
change simple.
I'm sorry for posting it so late, I forgot and the issue email reminded me.
Original comment by rap...@gmail.com
on 24 Jul 2010 at 7:35
Attachments:
Original issue reported on code.google.com by
rap...@gmail.com
on 7 Jun 2010 at 2:27