0.4.10 • Published 5 years ago

@nll/api-codegen-ts v0.4.10

Weekly downloads
23
License
MPL-2.0
Repository
github
Last release
5 years ago

api-codegen-ts

A general typescript code generation library. Currently it can take swagger 2.0 and openapi 3.0.0+ json specs and turn them into typescript controllers that validate api responses.

Installation

npm i -D @nll/api-codegen-ts

Configuration

Add an apiCodegen section to package.json.

{
  "apiCodegen": {
    "src": "./path/to/your/swagger-spec.json",
    "dst": "./path/to/your/codegen/destination"
  }
}

Usage

After configuring api-codegen-ts you can generate code like so:

npx @nll/api-codegen-ts

And it will output its progress and output code.

Advanced usage

This codegen library abstracts parsers and printers. A parser is responsible for receiving an input string (a specification) and generating any intermediate representation. Currently, there are primitive swagger 2.0 and openapi 3.0.0 parsers. A printer takes an intermediate representation (it must match whatever the parser outputs) and returns the file strings to write to disk. The core functionality of api-codegen-ts is managing this workflow, it handles the reading of the source files and the printing of the generated files.

Support

This is my first attempt at a codegen library. If you find bugs or some set of features that aren't supported please create a github issue. Thanks!

0.4.10

5 years ago

0.4.9

5 years ago

0.4.8

5 years ago

0.4.7

5 years ago

0.4.6

5 years ago

0.4.5

5 years ago

0.4.4

5 years ago

0.4.3

5 years ago

0.4.2

5 years ago

0.4.1

5 years ago

0.4.0

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago