Closed
Description
The default value of the $data
parameter for JsonResponse
is null, but when it is set to null, the actual value sent in the response is in fact {}
. This is problematic because it makes it impossible to send a literal value of null
, which is valid JSON. The distinction is important, because in javascript {}
evaluates truthy and null
evaluates falsy.