CONFIGURATION

map

default

This is the 'fall-back' Content-Type if none of the requested or acceptable types is found in the "map". It must be an entry in the "map".

stash_key

Specifies the key of the stash entry holding the data that is to be serialized. So if the value is "rest", we will serialize the data under:

$c->stash->{'rest'}

content_type_stash_key

Specifies the key of the stash entry that optionally holds an overriding Content-Type. If set, and if the specified stash entry has a valid value, then it takes priority over the requested content types.

This can be useful if you want to dynamically force a particular content type, perhaps for debugging.

HELPFUL PEOPLE

Daisuke Maki pointed out that early versions of this Action did not play well with others, or generally behave in a way that was very consistent with the rest of Catalyst.

CUSTOM ERRORS

For building custom error responses when serialization fails, you can create an ActionRole (and use Catalyst::Controller::ActionRole to apply it to the end action) which overrides unsupported_media_type and/or _serialize_bad_request methods.