Automatically generate TypeScript client code for ASP.NET Core controllers

前端 未结 6 878
醉话见心
醉话见心 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 18:36

    1. Both NSwag and Swashbuckle/swagger-codegen are awesome.

      1. Typewriter is another awesome option.

      2. So, here is how I would take the decision:

        • Need to generate TypeScript Models as per the C# models, go for TypeWriter
        • Need to generate complete client side code with command line that you can add as a build or publish step go for Swagger Code Gen

        • Need to play with the generated Swagger Spec or Generated Code to add your customizations - go for NSwag

        • Need to show Client inline code snippets in Swagger UI, use SwaggerUI-snippets

提交回复
热议问题