Is there code generation API for TypeScript?

前端 未结 5 2098
不知归路
不知归路 2021-02-12 11:17

When I needed to generate some C# code, for example DTO classes from xsd schema, or an excel table, I\'ve used some roslyn API\'s.

Is there something simmilar for typescr

5条回答
  •  旧巷少年郎
    2021-02-12 12:15

    When we needed to add support for consuming our RESTful APIs to a MEAN stack using Angular 4 and TypeScript, we used http://editor.swagger.io and passed in the JSON version of a Swagger 2.0 API definition, then selected client generator for TypeScript.

    Of course we cheated a little, in that we used SZ Architech (http://www.solution.zone) to create the RESTful APIs in the first place, which uses SwaggerUi to document the generated APIs, and allows us to just copy the Swagger 2.0 definition to use Swagger's code generation for the client code.

提交回复
热议问题