[Catalyst] Catalyst::Controller::REST and JSON::XS - Namespace/Custom modules

Matt S Trout dbix-class at trout.me.uk
Sun Apr 6 17:55:24 BST 2008


On Sun, Mar 16, 2008 at 10:27:54PM +0100, Simon Zmijanow wrote:
> Hello list,
> 
> Started last month with Catalyst and got fascinated with all the nice 
> things one can do with it.
> 
> But now got a little question and hope it is not too stupid :-)
> 
> I must admit, I don't have a clue how to cleanly load my custom 
> module/class into the frameworks namespace (anywhere, not only into the 
> Schema part)
> 
> I'm using Catalyst::Controller::REST in my application and want to use 
> JSON::XS serializer instead of default JSON::Syck (By the way, why is 
> Syck still default x-json serializer - even the comment in Syck advises 
> us to change to more reliable XS)
> 
> So I copied the two JSON wrappers from Action directory into my 
> application dir, modified them to use JSON::XS and renamed them into 
> JSONXS. The Catalyst::Controller::REST got config option map 'JSONXS'. 

They should load automatically if they're in lib/ since Module::Pluggable
will search anything in @INC and that's how Catalyst::Action::SerializeBase
finds the modules.

The map entry should be all that's required - if that's -not- working then
you need to post your code and your config so we can try and figure out
what's going wrong.

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/            http://www.shadowcat.co.uk/servers/



More information about the Catalyst mailing list