On 08.04.2013 06:48, Mike Haas wrote: > I of course meant JsonResponse when I mentioned JsonResult ;) > > On Sunday, April 7, 2013 11:45:50 PM UTC-5, Mike Haas wrote: > > I'm thinking JsonResponse should also accept a string of already > serialized JSON and not just a PHP array. > > I'm using JMSSerializerBundle to serialize my doctrine query object > into json. I then want the response to be that json. > I like using JsonResult because it's clean and I don't have to set > the content type. However, because it doesn't accept raw json > I have to use a regular Response and set the content type manually. > > Are there any design decisions that suggest this is a bad idea? > Otherwise I was thinking about submitting a PR.
The problem is that you'd need a new argument to specify you're passing json data already. Otherwise we can't distinguish a string from a json string. You can always do: return JsonResponse::create('')->setContent($encodedString); Cheers -- Jordi Boggiano @seldaek - http://nelm.io/jordi -- -- If you want to report a vulnerability issue on Symfony, please read the procedure on http://symfony.com/security You received this message because you are subscribed to the Google Groups "symfony developers" group. To post to this group, send email to symfony-devs@googlegroups.com To unsubscribe from this group, send email to symfony-devs+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-devs?hl=en --- You received this message because you are subscribed to the Google Groups "Symfony developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to symfony-devs+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.