All Projects → mstssk → Sw2dts

mstssk / Sw2dts

Licence: mit
Generates TypeScript definition file(d.ts) from swagger.json for edge cases.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Sw2dts

Tropical Fish
Pragmatic 风格的 Java EE 后端开发脚手架,开箱即用。基于 SpringBoot,技术选型采用主流的框架(Mybatis-Plus,Redisson,Xxl-job,Swagger)。项目特点:自定义查询语法, 可以自由组装查询条件查询数据,配合代码生成模块,提高研发效率;自定义 service 方法级别的文档生成规则,在业务方法增加必要的注解,可生成方法调用树,快速把握复杂代码业务逻辑。
Stars: ✭ 142 (+7.58%)
Mutual labels:  swagger, generator
Swagger Typescript Api
TypeScript API generator via Swagger scheme
Stars: ✭ 342 (+159.09%)
Mutual labels:  swagger, generator
Spring Boot Plus
🔥 Spring-Boot-Plus is a easy-to-use, high-speed, high-efficient,feature-rich, open source spring boot scaffolding. 🚀
Stars: ✭ 2,198 (+1565.15%)
Mutual labels:  swagger, generator
Gf Cli
GoFrame Command Line Interface, which is your helpmate for building GoFrame application with convenience.
Stars: ✭ 143 (+8.33%)
Mutual labels:  swagger, generator
Openapi Mock Generator
Progressive Web App for generating mocked data from an OpenAPI specification
Stars: ✭ 72 (-45.45%)
Mutual labels:  swagger, generator
full-stack-flask-couchdb
Full stack, modern web application generator. Using Flask, CouchDB as database, Docker, Swagger, automatic HTTPS and more.
Stars: ✭ 28 (-78.79%)
Mutual labels:  generator, swagger
Openapi Typescript Codegen
NodeJS library that generates Typescript or Javascript clients based on the OpenAPI specification
Stars: ✭ 249 (+88.64%)
Mutual labels:  swagger, generator
Swaggen
OpenAPI/Swagger 3.0 Parser and Swift code generator
Stars: ✭ 385 (+191.67%)
Mutual labels:  swagger, generator
Full Stack
Full stack, modern web application generator. Using Flask, PostgreSQL DB, Docker, Swagger, automatic HTTPS and more.
Stars: ✭ 451 (+241.67%)
Mutual labels:  swagger, generator
Datamodel Code Generator
Pydantic model generator for easy conversion of JSON, OpenAPI, JSON Schema, and YAML data sources.
Stars: ✭ 393 (+197.73%)
Mutual labels:  swagger, generator
Node Typescript Mongodb
node js typescript mongodb express generator yo
Stars: ✭ 96 (-27.27%)
Mutual labels:  swagger, generator
Api Client Generator
Angular REST API client generator from Swagger YAML or JSON file with camel case settigs
Stars: ✭ 92 (-30.3%)
Mutual labels:  swagger, generator
Laravel Swagger
Auto generates the swagger documentation of a laravel project based on best practices and simple assumptions
Stars: ✭ 129 (-2.27%)
Mutual labels:  swagger, generator
Open Api Renderer
🎩 A React renderer for OpenAPI v3.
Stars: ✭ 127 (-3.79%)
Mutual labels:  swagger
Angular Swagger Ui
An angularJS implementation of Swagger UI
Stars: ✭ 131 (-0.76%)
Mutual labels:  swagger
Client Python
A python client library for accessing Polygon's APIs
Stars: ✭ 127 (-3.79%)
Mutual labels:  swagger
Generator
Express' application generator
Stars: ✭ 1,644 (+1145.45%)
Mutual labels:  generator
Mentorship Backend
Mentorship System is an application that matches women in tech to mentor each other, on career development, through 1:1 relations during a certain period of time. This is the backend of this system.
Stars: ✭ 132 (+0%)
Mutual labels:  swagger
Swagger Inflector
Stars: ✭ 131 (-0.76%)
Mutual labels:  swagger
Tsed
📐 Ts.ED is a Node.js and TypeScript framework on top of Express to write your application with TypeScript (or ES6). It provides a lot of decorators and guideline to make your code more readable and less error-prone.
Stars: ✭ 1,941 (+1370.45%)
Mutual labels:  swagger

sw2dts

npm version Circle CI

Generates TypeScript definition file(d.ts) from swagger.json for edge cases.

Attention

sw2dts wraps dtsgenerator to provides several features for edge cases.

I recommend to use dtsgenerator directly or other generators such as Swagger Codegen, if you use swagger generally.

Install

$ npm install -g sw2dts

or, install with --save-dev option to use in npm scripts.

Usage

  Usage: sw2dts [options] [--] [input_filename]

  Options:

    -w, --with-query                With GET query parameters.
    -s, --sort-props                Sort type properties order.
    -o, --output <output_filename>  Output to file.
    -n, --namespace <namespace>     Use namespace.
    --stdin                         [Deprecated] Input from standard input.
  • input_filename should be swagger.json(or yaml) file.

Example

$ sw2dts swagger.json > output.d.ts
$ sw2dts -o output.d.ts swagger.json
$ sw2dts --namespace foo -o output.d.ts swagger.json
$ cat swagger.json | sw2dts -swo output.d.ts

Tips

Use sw2dts in your script.

Sample:

import * as sw2dts from 'sw2dts';

let data: sw2dts.SwaggerSpec = { /* swagger data */ };

let option: sw2dts.ConverterOptions = {
    namespace: 'foo',
    
    // includes GET query parameters.
    withQuery: true, 
    
    // modify GET query parameters interface name.
    nameResolver: (path: string, pathDefinition: sw2dts.PathDefinition, options: sw2dts.ConverterOptions) => {
        return 'any name as you like'; // WARN: sw2dts will convert this name to PascalCase.
    }
};

sw2dts.convert(data, option).then(dts => {
    console.log(dts);
});

How to build

npm cit
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].