Currently, I am exploring NativeScript and Angular2 with ServiceStack in C# as the backend.
To develop the application, I utilized the typescript-ref
command to generate TypeScript classes for use with the JsonServiceClient
in ServiceStack:
>typescript-ref http://192.168.0.147:8080 RestApi
Everything seemed fine until I noticed that it appears to be overlooking the fact that ServiceStack Services and Response DTOs are located in different namespaces on the .NET side:
https://i.sstatic.net/Nk3Oz.png
I have multiple branches of services where each service may have slightly different handlers between the branches. This setup works seamlessly in ServiceStack, especially with the Login and handlers functioning as expected.
For the app built with NativeScript/Angular2, I used the typescript-ref
tool to create the restapi.dtos.ts
. However, it seems to ignore the namespace disparity and produces duplicate classes instead (as seen in VSCode):
https://i.sstatic.net/jwdsT.png
The backend WS in ServiceStack follows a "branched" approach so I can avoid running different services on separate ports but rather consolidate them all on one port for simplicity and clarity.
Is there a solution to my issue?