New option json_options_encode to set JSON options for output
[catagits/Catalyst-Action-REST.git] / lib / Catalyst / Controller / REST.pm
index 428d749..12568f7 100644 (file)
@@ -147,11 +147,22 @@ L<JSON::XS> installed.  The C<text/x-json> content type is supported but is
 deprecated and you will receive warnings in your log.
 
 You can also add a hash in your controller config to pass options to the json object.
+There are two options. C<json_options> are used when decoding incoming JSON, and C<json_options_encode> 
+is used when encoding JSON for output.
+
 For instance, to relax permissions when deserializing input, add:
+
   __PACKAGE__->config(
     json_options => { relaxed => 1 }
   )
 
+To indent the JSON output so it becomes more human readable, add:
+
+  __PACKAGE__->config(
+    json_options_encode => { indent => 1 }
+  )
+
+
 =item * C<text/javascript> => C<JSONP>
 
 If a callback=? parameter is passed, this returns javascript in the form of: $callback($serializedJSON);