Version update to 0.61, updated changelog
[catagits/Catalyst-Action-REST.git] / lib / Catalyst / Controller / REST.pm
index 6123010..0ce7c44 100644 (file)
@@ -1,5 +1,7 @@
 package Catalyst::Controller::REST;
 
+our $VERSION = 0.61;
+
 =head1 NAME
 
 Catalyst::Controller::REST - A RESTful controller 
@@ -208,7 +210,7 @@ such require you pass the current context ($c) as the first argument.
 use strict;
 use warnings;
 use base 'Catalyst::Controller';
-use Params::Validate qw(:all);
+use Params::Validate qw(SCALAR OBJECT);
 
 __PACKAGE__->mk_accessors(qw(serialize));
 
@@ -218,6 +220,7 @@ __PACKAGE__->config(
             'text/html'          => 'YAML::HTML',
             'text/xml'           => 'XML::Simple',
             'text/x-yaml'        => 'YAML',
+            'application/json'   => 'JSON',
             'text/x-json'        => 'JSON',
             'text/x-data-dumper' => [ 'Data::Serializer', 'Data::Dumper' ],
             'text/x-data-denter' => [ 'Data::Serializer', 'Data::Denter' ],
@@ -253,7 +256,7 @@ Example:
 sub status_ok {
     my $self = shift;
     my $c    = shift;
-    my %p    = validate( @_, { entity => 1, }, );
+    my %p    = Params::Validate::validate( @_, { entity => 1, }, );
 
     $c->response->status(200);
     $self->_set_entity( $c, $p{'entity'} );
@@ -283,7 +286,7 @@ This is probably what you want for most PUT requests.
 sub status_created {
     my $self = shift;
     my $c    = shift;
-    my %p    = validate(
+    my %p    = Params::Validate::validate(
         @_,
         {
             location => { type     => SCALAR | OBJECT },
@@ -321,7 +324,7 @@ Example:
 sub status_accepted {
     my $self = shift;
     my $c    = shift;
-    my %p    = validate( @_, { entity => 1, }, );
+    my %p    = Params::Validate::validate( @_, { entity => 1, }, );
 
     $c->response->status(202);
     $self->_set_entity( $c, $p{'entity'} );
@@ -346,7 +349,7 @@ Example:
 sub status_bad_request {
     my $self = shift;
     my $c    = shift;
-    my %p    = validate( @_, { message => { type => SCALAR }, }, );
+    my %p    = Params::Validate::validate( @_, { message => { type => SCALAR }, }, );
 
     $c->response->status(400);
     $c->log->debug( "Status Bad Request: " . $p{'message'} ) if $c->debug;
@@ -372,7 +375,7 @@ Example:
 sub status_not_found {
     my $self = shift;
     my $c    = shift;
-    my %p    = validate( @_, { message => { type => SCALAR }, }, );
+    my %p    = Params::Validate::validate( @_, { message => { type => SCALAR }, }, );
 
     $c->response->status(404);
     $c->log->debug( "Status Not Found: " . $p{'message'} ) if $c->debug;
@@ -415,6 +418,7 @@ This class provides a default configuration for Serialization.  It is currently:
             'text/html'          => 'YAML::HTML',
             'text/xml'           => 'XML::Simple',
             'text/x-yaml'        => 'YAML',
+            'application/json'   => 'JSON',
             'text/x-json'        => 'JSON',
             'text/x-data-dumper' => [ 'Data::Serializer', 'Data::Dumper' ],
             'text/x-data-denter' => [ 'Data::Serializer', 'Data::Denter' ],