Giter Site home page Giter Site logo

dtsgenerator's Introduction

dtsgenerator

TypeScript d.ts file generator from JSON Schema file or OpenAPI(Swagger) spec file.

nodejs version npm version build status coverage status Greenkeeper badge npm download count MIT license

Table of Contents

Install

npm install -g dtsgenerator

Usage

$ dtsgen --help

  Usage: dtsgen [options] <file ... | file patterns using node-glob>


  Options:

    -V, --version                      output the version number
    --url <url>                        input json schema from the url.
    --stdin                            read stdin with other files or urls.
    -o, --out <file>                   output d.ts filename.
    -p, --prefix <type prefix>         set the prefix of interface name. default is nothing.
    -H, --header <type header string>  set the string of type header.
    -t, --target [version]             set target TypeScript version. select from `v2` or `v1`. default is `v2`.
    -h, --help                         output usage information

  Examples:

    $ dtsgen --help
    $ dtsgen --out types.d.ts schema/**/*.schema.json
    $ cat schema1.json | dtsgen --target v1
    $ dtsgen -o swaggerSchema.d.ts --url https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/schemas/v2.0/schema.json
    $ dtsgen -o petstore.d.ts --url https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v2.0/yaml/petstore.yaml

Development

Debug

Output debug message by debug library.

$ DEBUG=dtsgen dtsgen schema/news.json

Links about JSON Schema and Swagger

Supported spec version

  • JSON Schema
    • draft-04
  • OpenAPI
    • OpenAPI Specification 2.0

ChangeLog

v0.9.9 (2018-01-12)

  • Bug fix about previous version code by #267. Thank you @bricka :*+1:

v0.9.8 (2018-01-09)

  • Bug fix about a block comment code in example node by #221. Thank you @GongT :*+1:

v0.9.7 (2017-12-12)

  • Support the integer enum type by #263. Thank you @heapx :*+1:

v0.9.6 (2017-09-28)

  • Bug fix about unresoled $refs by #253. Thank you @skuligowski ๐Ÿ‘

v0.9.5 (2017-07-24)

  • Bug fix about tuple type support by #244. Thank you @laurelnaiad ๐Ÿ‘

v0.9.4 (2017-07-22)

  • Support tuple type of #239, #241. Thank you @laurelnaiad ๐Ÿ‘

v0.9.2 (2017-06-19)

  • Fix the bug about allOf property of #226. Thank you @dawidgarus @philliphoff ๐Ÿ‘

v0.9.1 (2017-01-27)

  • Improve message in error log. Thank you @gasi ๐Ÿ‘

v0.9.0 (2016-12-15)

  • Add yaml format support! Thank you @jdthorpe ๐Ÿ‘

v0.8.2 (2016-11-7)

  • Remove gulp scripts

v0.8.1 (2016-10-24)

v0.8.0 (2016-10-16)

  • Add to support null type for TypeScript 2.0
  • Add some input parameters

v0.7.2 (2016-9-19)

  • Update dependencies library

v0.7.1 (2016-7-5)

  • Fix crash bug #67

v0.7.0 (2016-7-3)

  • Update with some braking change

v0.6.1 (2016-4-28)

  • Minor update from v0.6.0

v0.6.0 (2016-4-14)

  • First stable version of dtsgenerator

License

dtsgenerator is licensed under the MIT license.

Copyright ยฉ 2016-2018, Hiroki Horiuchi

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.