use Catalyst::Request::REST;
use Catalyst::Utils ();
-our $VERSION = '0.81';
+our $VERSION = '0.90';
$VERSION = eval $VERSION;
-sub new {
- my $class = shift;
- my $config = shift;
- Catalyst::Request::REST->_insert_self_into( $config->{class} );
- return $class->SUPER::new($config, @_);
-}
+after BUILDARGS => sub {
+ my $class = shift;
+ my $config = shift;
+ Catalyst::Request::REST->_insert_self_into( $config->{class} );
+};
-__PACKAGE__->mk_accessors(qw(_serialize_plugins _loaded_plugins));
+has [qw(_serialize_plugins _loaded_plugins)] => ( is => 'rw' );
sub _load_content_plugins {
my $self = shift;
push @accepted_types, @$stashed;
}
# then content types requested by caller
- push @accepted_types, @{ $c->request->accepted_content_types };
+ push @accepted_types,
+ $search_path =~ m{Deserialize}
+ ? @{ $c->request->accepted_content_types }
+ : @{ $c->request->accepted_response_content_types }
+ ;
+
# then the default
push @accepted_types, $config->{'default'} if $config->{'default'};
# pick the best match that we have a serializer mapping for
return undef;
}
+__PACKAGE__->meta->make_immutable;
+
1;
=head1 NAME
-B<Catalyst::Action::SerializeBase>
-
-Base class for Catalyst::Action::Serialize and Catlayst::Action::Deserialize.
+Catalyst::Action::SerializeBase - Base class for Catalyst::Action::Serialize and Catlayst::Action::Deserialize.
=head1 DESCRIPTION