use namespace::autoclean;
extends 'Catalyst::Action';
-use JSON ();
-
-our $VERSION = '0.90';
-$VERSION = eval $VERSION;
+use JSON::MaybeXS qw(JSON);
has encoder => (
is => 'ro',
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'} :