ddavisqa / google-refine

Automatically exported from code.google.com/p/google-refine
0 stars 0 forks source link

jsonize not serializing arrays #125

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
In templating export I would like to out put a json array as a child to the 
json ojcect.

For example assuming I have a column that contains strings delimited by commas, 
e.g.:

"one,two,three"

and I want a json obeject that looks like this:

    {
      "column_split" : ["one", "two", "three"],
    }

I assumed this would work for the template:

   {
      "column_split" : {{jsonize(cells["column"].value.split(","))}},
    }

But jsonize returned strings like: [Ljava.lang.String;@d7e60a1

So I had to do this:'

   {
      "column_split" : [{{forEach(cells["column_name"].value.split(","), v, jsonize(v)).join(", ")}}],
    }

Which seems hacky.

Original issue reported on code.google.com by thejeffl...@gmail.com on 8 Sep 2010 at 6:11

GoogleCodeExporter commented 8 years ago

Original comment by stefa...@google.com on 16 Sep 2010 at 10:19

GoogleCodeExporter commented 8 years ago
Fixed in r1269.

Original comment by stefa...@google.com on 16 Sep 2010 at 11:08

GoogleCodeExporter commented 8 years ago

Original comment by tfmorris on 18 Sep 2012 at 2:58