From: Alexander Hartmaier Date: Tue, 23 Sep 2014 15:22:36 +0000 (+0200) Subject: improve data_root & item_root documentation X-Git-Tag: 2.007001~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Controller-DBIC-API.git;a=commitdiff_plain;h=7986e6b7913523782ad8186eca3f858ea927c6b2 improve data_root & item_root documentation --- diff --git a/Changes b/Changes index 2dc6b04..da37718 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,7 @@ Revision history for Catalyst-Controller-DBIC-API: {{ $dist->version }} {{ $NEXT }} + - Improve data_root & item_root documentation 2.006002 2014-08-26 12:31:27+02:00 Europe/Vienna - Fix missing Data::Printer test requirement diff --git a/lib/Catalyst/Controller/DBIC/API.pm b/lib/Catalyst/Controller/DBIC/API.pm index f90891a..7b79e31 100644 --- a/lib/Catalyst/Controller/DBIC/API.pm +++ b/lib/Catalyst/Controller/DBIC/API.pm @@ -63,7 +63,8 @@ __PACKAGE__->config(); ], ordered_by => ['age'], search_exposes => ['age', 'nickname', { cds => ['title', 'year'] }], - data_root => 'data', + data_root => 'list', + item_root => 'data', use_json_boolean => 1, return_object => 1, ); @@ -1140,11 +1141,17 @@ Controls where in stash request_data should be stored, and defaults to 'response =head3 data_root -By default, the response data is serialized into +By default, the response data of multiple item actions is serialized into $c->stash->{$self->stash_key}->{$self->data_root} and data_root defaults to 'list' to preserve backwards compatibility. This is now configuable to meet the needs of the consuming client. +=head3 item_root + +By default, the response data of single item actions is serialized into +$c->stash->{$self->stash_key}->{$self->item_root} and item_root default to +'data'. + =head3 use_json_boolean By default, the response success status is set to a string value of "true" or