8000 GitHub - everton-amorim/swagger-ts-template: Generates TS typedefs and/or API client from swagger.json.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

everton-amorim/swagger-ts-template

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

swagger-ts-template

(quick n dirty script that) Generates a d.ts file containing the type definitions from a swagger .json file.

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

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

Full API client

The apigen branch also contains a full-fledged API consumer generator. Check it out!

Options

  • hideComments 52AF : 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]

About

Generates TS typedefs and/or API client from swagger.json.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 57.3%
  • TypeScript 42.7%
0