Hello Everyone, I need an advice about my situation.
I have a backend implemented using ASP.NET Core, which basically contains 100-150 services (API). We documented it using Swagger and for the front end we are using angular 11. THE QUESTION: Is there any tool that can generate these APIs with their definition from the back end as Angular 2 methods? It is really not effective to redefine all these methods manually again in the frontend. Is there is any library that I can use to generate a file (like a proxy) that contains a set of methods where each method has an httpclient which contains the info (baseURL+endpoint), method type like post or get, the parameters that this API needs and the response interface?
Take a look at Swagger CodeGen, https://swagger.io/tools/swagger-codegen.
If isomorphic Typescript is an option, you might take a look at autorest as well:
https://github.com/Azure/autorest.typescript
You can use NSwag: https://docs.microsoft.com/en-us/aspnet/core/tutorials/getting-started-with-nswag?view=aspnetcore-6.0&tabs=visual-studio
And with additional package NSwag.MSBuild you can generate ts-client while build your ASP.NET Core project in Visual Studio.