I'm a bit of a Catalyst newbie, and I'm trying to get multiple chains to access the same endpoint ('description' subroutine) e.g:
/object/fetch_by_id/*/description
/object/fetch_by_name/*/description
/object/fetch_by_xref/*/description
I don't want to have to write code for 3 separate endpoints for example and instead allow the endpoint to be shared between the three different chained actions. I am wrapping a backend API and in this example the object can be retrieved via different methods.
The ideal solution would be:
sub description : Chained('fetch_by_id','fetch_by_name','fetch_by_xref') PathPart('description') Args(0) ActionClass('REST') {
# code here
}
Or I could write different description subs for each chain that all call the generic description subroutine, but any more elegant solutions would be great! Any help should be greatly appreciated!