Merge branch 'master' of https://github.com/runarbu/Catalyst-Action-REST into runarbu...
[catagits/Catalyst-Action-REST.git] / lib / Catalyst / Action / Serialize / JSON.pm
index 9d5f304..e618248 100644 (file)
@@ -20,6 +20,12 @@ sub execute {
     my $self = shift;
     my ( $controller, $c ) = @_;
 
+    if (my $options = $controller->{json_options_encode}) {
+        foreach my $opt (keys %$options) {
+            $self->encoder->$opt( $options->{$opt} );
+        }
+    }
+
     my $stash_key = (
             $controller->{'serialize'} ?
                 $controller->{'serialize'}->{'stash_key'} :