Annotations need to be enabled by default in TypeScript before we can emit them, adding any non-standard approach now will break anyone relying on the when we move to annotations in future.
You can programmatically fetch metadata about your Services at /types/metadata which also contains the Route info for each Service.
Thanks, I get it that you like to commit to standard features.
In the mean time, I still think it would be nice to have a generated class separate from the interfaces, with a string const for each route, just to safeguard against refactorings. That won’t break but would become redundant. The meta-data is nice, but requires me to do the code-gen to TypeScript.
I’ll let it be for now – I like the the whole full stack experience with ServiceStack and React/Typescript a lot BTW.
If you’re using TypeScript why not use these DTOs with the TypeScript servicestack-client that way you won’t need to deal with manually constructing the urls yourself? e.g:
var client = new JsonServiceClient("http://example.org");
client.post(new GetCustomers())
.then(r => { // r:GetCustomersResponse
})
.catch(e => {
});