1.5.0 • Published 7 years ago

swagger-ts-template v1.5.0

Weekly downloads
5
License
MIT
Repository
github
Last release
7 years ago

swagger-ts-template

Generates a d.ts file containing the type definitions from a swagger .json file.

This is a simple node script and is not related with the swagger-codegen structure. (**)

var generator = require('swagger-ts-template')
var source = require('api.json')

let output = generator.merge(source, {hideComments:true})
fs.writeFileSync('api.d.ts', output)

Options

  • hideComments: If true, properties descriptions will not be included as comments in the generated file.

  • external: Formats the types as export type, making the file an external module.

CLI

This module may be installed globally and used as a command-line tool.

npm i swagger-ts-template --global
tstemplate <source> <dest> [-c] [-e]

(**) Do not expect full swagger coverage; this is mostly a quick script I used internally and wanted to publish.

1.5.0

7 years ago

1.4.1

7 years ago

1.4.0

7 years ago

1.3.0

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.0

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago