Demo project for Himenon/openapi-typescript-code-generator
This section describes the specific steps for code generation.
First, you need to clone this repository.
git clone https://github.com/Himenon/openapi-typescript-code-generator-demo-project
Then go to the cloned directory and install the package.
cd openapi-typescript-code-generator-demo-project
yarn install
The setup is now complete.
Let's actually create the code in Usage.
The OpenAPI Schema to be loaded is openapi.yml
.
Also, the actual code to be executed will be written in plain JavaScript.
Examples to DEMO:Generate typedef-only code
Execute the following command to generate the code in the demo1 directory.
node generate-demo1.js
Examples to DEMO:Generate code containing the API Client
Execute the following command to generate the code in the demo2 directory.
node generate-demo2.js
Examples to DEMO:Split the type definition file and the API Client implementation
Execute the following command to generate the code in the demo3 directory.
node generate-demo3.js
@himenon/openapi-typescript-code-generator provides a mechanism for generating code from OpenAPI Schema.
It also uses TypeScript itself directly internally. Therefore, if you do not have this typescript package installed, you will not be able to generate code.