Making the default serializer be specified by content-type, not module.
[catagits/Catalyst-Action-Serialize-Data-Serializer.git] / lib / Catalyst / Controller / REST.pm
index 1017cb1..3761f07 100644 (file)
@@ -158,15 +158,26 @@ you serialize be a HASHREF, we transform outgoing data to be in the form of:
 
   { data => $yourdata }
 
+=item L<View>
+
+Uses a regular Catalyst view.  For example, if you wanted to have your 
+C<text/html> and C<text/xml> views rendered by TT:
+
+       'text/html' => [ 'View', 'TT' ],
+       'text/xml'  => [ 'View', 'XML' ],
+       
+Will do the trick nicely. 
+
 =back
 
-By default, L<Catalyst::Controller::REST> will return a C<415 Unsupported Media Type> response if an attempt to use an unsupported content-type is made.  You
-can ensure that something is always returned by setting the C<default> config
-option:
+By default, L<Catalyst::Controller::REST> will return a C<415 Unsupported Media Type>
+response if an attempt to use an unsupported content-type is made.  You
+can ensure that something is always returned by setting the C<default>
+config option:
 
-   __PACKAGE__->config->{'serialize'}->{'default'} = 'YAML';
+   __PACKAGE__->config->{'serialize'}->{'default'} = 'text/x-yaml';
 
-Would make it always fall back to YAML.
+Would make it always fall back to the serializer plugin defined for text/x-yaml.
 
 Implementing new Serialization formats is easy!  Contributions
 are most welcome!  See L<Catalyst::Action::Serialize> and
@@ -416,8 +427,7 @@ This class provides a default configuration for Serialization.  It is currently:
 ],
             'text/x-config-general' => [ 'Data::Serializer', 'Config::General' ]
 ,
-            'text/x-php-serialization' => [ 'Data::Serializer', 'PHP::Serializat
-ion' ],
+            'text/x-php-serialization' => [ 'Data::Serializer', 'PHP::Serialization' ],
           },
       }
   );