Automatically generate TypeScript client code for ASP.NET Core controllers

前端 未结 6 866
醉话见心
醉话见心 2021-01-30 18:23

I\'m searching for a way to automatically generate the TypesScript client code from a ASP.NET Core Web-Application (Currently using Visual Studio 2017RC and webpack).

Ar

6条回答
  •  无人及你
    2021-01-30 19:00

    Another option is NSwag which can generate Swagger specs from your ASP.NET (Core) controllers and TypeScript clients from this Swagger spec (for Angular, AngularJS, Fetch, etc.). The integration is very simple and it supports many advanced features (inheritance, named enums, code extensions, etc).

    http://NSwag.org

    Using the NSwagStudio UI it is very simple to get started and then you can automate everything with NPM package (i.e. running the config file in the cmd line).

    I'm one of the authors of the project.

提交回复
热议问题