[Seaside] WAJsonCanvas

Esteban A. Maringolo emaringolo at gmail.com
Mon Feb 24 16:37:10 UTC 2014

2014-02-22 17:15 GMT-03:00 Johan Brichau <johan at inceptive.be>:
> Hi Esteban,

> But this example makes me think... I would actually want to write it as follows:
>         WAJsonCanvas builder render: [ :json |
>                 json array: [
>                         WADocument  allSubclasses do:[:each |
>                                 json object: [ json key: 'name' value: each name ]]]]

> i.e. without the #value: message. I would expect the canvas to put a comma in between different objects. An 'object' is actually a 'value' in the json syntax.
> It might make sense.

Yes, I would expect that usage too.

But even when it's not a common use case scenario, you could have a
mixed objects array.

Something like: ['string', 3.14, {key: 'value', foo: 'baz'}, [...], false]

In that case it wouldn't be just "extending" the WAJsonObjectBrush
openTag, but it should be something at other level, that let you
manage the elements any way you want. Hence the #element: method.


Esteban A. Maringolo

More information about the seaside mailing list