Extend the api to allow Reverse Routing
An option would be to open the access to Routes.
This would allow to separate the concerns of application workflow in services (describing next operations if required) from route resolution (which could be done in a filter or in the appconfig).

-
Ok great, thx.
-
Javier Ruiz Aranguren commented
Beautiful :-)
EndpointHost.Config.Metadata.Routes.RestPaths
I think this should marked as solved. I update stackoverflow post.
Thanks, Demis. -
Understood, you want a nice story for adding hypermedia links.
For the routing info, do you know about the Routing Metadata where ServiceStack keeps all the routing info? https://github.com/ServiceStack/ServiceStack/wiki/Routing#routing-metadata
i.e. accessible in ServiceStack at EndpointHost.Config.Metadata or externally at /operations/metadata - if there's missing routing info you need that's not there let me know.
-
Javier Ruiz Aranguren commented
Thank you, Demis. I knew about this option and it works. There is also a stackoverflow question where an example is provided with detail: http://stackoverflow.com/questions/18351944/hypermedia-links-with-servicestack-new-api
We are know storing the routes in a custom dictionary to get this functionality without the need for [Route] and IReturn.
It might be jsut a matter of taste, but we prefer to have routing concern in apphost, contracts isolated from cross-cutting and workflow logic (ireturn, next steps, etc.) in services.
Would have any collateral "bad" effect to open the access to Routes? -
For those interested, if you use `[Route]` attributes, you will be able to get the Url from a Request dto with:
dto.ToUrl(); //relative url
dto.ToAbsoluteUri(); //absloute url
See routing docs for more info: https://github.com/ServiceStack/ServiceStack/wiki/Routing#reverse-routing