how i can produce this json with the jbuilder DSL
{ data: undefined }
I think it is necessary to precise without explaining why that
{ data: null }
or
{ }
are not the same json as the first
CodePudding user response:
It means that undefined
is not supported by JSON
See also JSON site
In any case, sending undefined data from the backend to the frontend is quite strange. I believe that if there is such a need, it is better to use null
value or even not send anything