Thanks Dmitry:) that actually works for me too if i change my route from /patients/{patientRef} to /patients/(.*) in the dispatch class. 

My only problem now is that my api specification says the route is /patients/{patientRef} and because we are using the iris api/mgmnt api to auto generate rest classes based on Swagger specification, my dispatch class is auto generated based on .spec class. My .disp class also gets overwritten everytime my .spec class is recompiled.  Any ideas on how to get around this?

Many thanks, 

Utsavi

Thanks Dmitry:) that actually works for me too if i change my route from /patients/{patientRef} to /patients/(.*) in the dispatch class. 

My only problem now is that my api specification says the route is /patients/{patientRef} and because we are using the iris api/mgmnt api to auto generate rest classes based on Swagger specification, my dispatch class is auto generated based on .spec class. My .disp class also gets overwritten everytime my .spec class is recompiled.  Any ideas on how to get around this?

Many thanks, 

Utsavi

Hi Eduard,

I am running in the same issue as Dan and trying out your solution in assumption that there is no other better way of handling this. Overriding OnPreDispatch doesn't seem to work for me. My URL seems decoded by then.

E.g. my API URL is

http://localhost:52773/mapi/admin/v1/patients/{patientReference} where patientReference contains a slash so client call would be something like

http://localhost:52773/mapi/admin/v1/patients/ipm%2F3245678

In my OnPreDisptach pUrl is  already decoded

v1/patients/ipm/3245678 

hence your solution doesn't seem to work. Am I missing something? Is there any  other way of handling this?

Thanks,

Utsavi

Hi @Matthieu

I am facing the same issue. Did you ever figured out how to catch exceptions thrown by your DTL ?

Many thanks,

Utsavi

Thanks Jeffrey. <alert> was it.  Do you know if there is a way of catching errors in a DTL ?