npm
Last updated
Last updated
Spec TypeScript code generation is packaged in form of npm package. Add following dependency to your project:
The has specgen command line tool is built inside of the npm package.
Add the following to package.json
:
In this specgen
script <command>
stands for specific command. Here are commands that generate TypeScript code: , , .
To run code generation execute specgen
script:
This page provides some examples of specgen scripts configuration.
The example below generates server with models to ./src/spec
and OpenAPI specification to ./docs/swagger.yaml
. The command also scaffolds services (only if they don't exist yet) that should be implemented by developers and puts the code into ./src/services
path.
Read documentation for command details.
The example below generates server with models to ./src/spec
and OpenAPI specification to ./docs/swagger.yaml
. The command also scaffolds services (only if they don't exist yet) that should be implemented by developers and puts the code into ./src/services
path.
Read documentation for command details.
The example below generates HTTP client with models from ./spec.yaml
speicification and puts generated code to ./src/spec
.
Read documentation for command details.
The example below generates models from ./spec.yaml
speicification and puts generated code to ./src/spec
.
Read documentation for command details.
The example below generates models from ./spec.yaml
speicification and puts generated code to ./src/spec
.
Read documentation for command details.