<serve-json> serve an object as JSON

name
serve-json
xml namespace
http://moyaproject.com

Serve an object encoded as JSON.

This tag with either serialize an object (obj) if provided, or serve the tag text as JSON.

Like other serve- tags, this will return a response and stop processing the view.

Example

<!-- serialize an object -->
<serve-json obj="{'status': 'ok'}"/>

<!-- just serve the contents -->
<serve-json>
{
    "crew": ["john", "scorpius"]
}
</serv-json>
attributes
name purpose type required? default choices
indent Indent to make JSON more readable integer No 4
obj Object to build JSON from expression No None
inherited attributes
name purpose type required? default choices
if Conditional expression expression No yes