On Tue, Dec 9, 2008 at 10:43 PM, Mark Ramm <[EMAIL PROTECTED]> wrote: > > There's a ticket requesting us to support and automatically jsonify > arrays in tg2. > > I don't think that's a good idea because with some trickery you get > some cross-site-scripting issues with JSON arrays, which you can't get > with json objects. And I don't want to go mucking through arrays > returned by controllers because it breaks using generators, which is > the the "right way" to return very large streams from a TG2 > controller. > > Of course arrays are and should be allowed allowed as values in the > controller's returned dictionary, so you can return lists as part of > your JSON response, but not as the root of the response. > > The ticket is here: > > http://trac.turbogears.org/ticket/2034 > > And the reasons why I think we should mark it as wontfix are in the > ticket. If there are objections to this, let me know.
I just saw the ticket and you already set it as wontfix, even though I agree with the resolution I think the reason is simple. top level array is invalid json! from the super simple spec here json.org you can see that the top level must always be a JS object which means at least one key which means always a python dict. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears Trunk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears-trunk?hl=en -~----------~----~----~----~------~----~------~--~---
