Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/himenon/openapi-typescript-code-generator-demo-project
Demo Project for @himenon/openapi-typescript-code-generator
https://github.com/himenon/openapi-typescript-code-generator-demo-project
openapi openapi-codegen openapi3
Last synced: 11 days ago
JSON representation
Demo Project for @himenon/openapi-typescript-code-generator
- Host: GitHub
- URL: https://github.com/himenon/openapi-typescript-code-generator-demo-project
- Owner: Himenon
- Created: 2021-04-08T14:44:28.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-09-12T14:18:28.000Z (about 3 years ago)
- Last Synced: 2024-10-11T20:59:35.089Z (about 1 month ago)
- Topics: openapi, openapi-codegen, openapi3
- Language: TypeScript
- Homepage: https://github.com/Himenon/openapi-typescript-code-generator
- Size: 271 KB
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Demo project for [Himenon/openapi-typescript-code-generator](https://github.com/Himenon/openapi-typescript-code-generator)
[日本語](./README_ja.md)
This section describes the specific steps for code generation.
## Setup
First, you need to clone this repository.
```sh
git clone https://github.com/Himenon/openapi-typescript-code-generator-demo-project
```Then go to the cloned directory and install the package.
```sh
cd openapi-typescript-code-generator-demo-project
yarn install
```The setup is now complete.
## Run demo
Let's actually create the code in [Usage](https://github.com/Himenon/openapi-typescript-code-generator#usage).
The OpenAPI Schema to be loaded is `openapi.yml`.Also, the actual code to be executed will be written in plain JavaScript.
### Demo1
Examples to DEMO:[Generate typedef-only code](https://github.com/Himenon/openapi-typescript-code-generator#generate-typedef-only-code)
Execute the following command to generate the code in the demo1 directory.
```sh
node generate-demo1.js
```### Demo2
Examples to DEMO:[Generate code containing the API Client](https://github.com/Himenon/openapi-typescript-code-generator#generate-code-containing-the-api-client)
Execute the following command to generate the code in the demo2 directory.
```sh
node generate-demo2.js
```## Demo3
Examples to DEMO:[Split the type definition file and the API Client implementation](https://github.com/Himenon/openapi-typescript-code-generator#split-the-type-definition-file-and-the-api-client-implementation)
Execute the following command to generate the code in the demo3 directory.
```sh
node generate-demo3.js
```## About the package you need
[@himenon/openapi-typescript-code-generator](https://www.npmjs.com/package/@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](https://www.npmjs.com/package/typescript) package installed, you will not be able to generate code.