0.1.1 • Published 10 months ago

ts-swagger-typegen v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

TS Swagger Typegen

The package is used to generate typescript types using Swagger documentation.

Installation

Step 1: Install ts-swagger-typegen
yarn add ts-swagger-typegen
Step 2: Create a configration file

Add a typegen.config.json with content:

{
  "dev": {
    "url": "<url_to_swagger>",
    "title": "<title>",
    "location": "<location_to_save_types>"
  }
}

Step 3: Add to scripts in package json

  "scripts": {
    "typegen": "ts-swagger-typegen"
  }

Step 4: Generate types

yarn typegen dev

You can change dev to any environment as specified in typegen.config.json

Best practices

  • Always gitignore the type file
  • Add configuration for all the environemnts
  • Generate the type before development and during build process

TODO

  • Eslint configuration
  • Add tests
  • Generation from multiple swagger
  • Service layer code
0.1.1

10 months ago

0.1.0

10 months ago

0.0.10

10 months ago

0.0.9

10 months ago

0.0.8

10 months ago

0.0.7

10 months ago

0.0.6

10 months ago

0.0.5

10 months ago

0.0.4

10 months ago

0.0.3

10 months ago

0.0.2

10 months ago

0.0.1

10 months ago