Skip to content

Commit

Permalink
docs(readme): update (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
Himenon committed Apr 8, 2021
1 parent c8285ca commit 819f22f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ yarn add -D @himenon/openapi-typescript-code-generator

## DEMO

- [DEMO](./example/README.md)
- [Short DEMO](https://github.com/Himenon/openapi-typescript-code-generator-demo-project)
- [DEMO: github/rest-api-client code generate](https://github.com/Himenon/github-rest-api-client/tree/master/source)
- https://github.com/github/rest-api-description

## Usage

The example shown here can be cloned from the [DEMO repository](https://github.com/Himenon/openapi-typescript-code-generator-demo-project) to see how it works.

### Generate typedef-only code

```ts
Expand Down Expand Up @@ -89,7 +91,7 @@ const main = () => {
const apiClientCode = codeGenerator.generateCode([
{
generator: () => {
return [`import { Schemas } from "./types";`];
return [`import { Schemas, Responses } from "./types";`];
},
},
codeGenerator.getAdditionalTypeDefinitionCustomCodeGenerator(),
Expand Down
6 changes: 4 additions & 2 deletions docs/ja/README-ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ OpenAPI から抽出したパラメーターは自由に使うことができる

## DEMO

- [DEMO](../example/README.md)
- [Short DEMO](https://github.com/Himenon/openapi-typescript-code-generator-demo-project)
- [DEMO: github/rest-api-client code generate](https://github.com/Himenon/github-rest-api-client/tree/master/source)
- https://github.com/github/rest-api-description

Expand All @@ -22,6 +22,8 @@ yarn add -D @himenon/openapi-typescript-code-generator

## 使い方

ここで記されている例は[DEMO用のリポジトリ](https://github.com/Himenon/openapi-typescript-code-generator-demo-project)をクローンして動作確認することができます。

### 型定義のみのコードを生成する

```ts
Expand Down Expand Up @@ -87,7 +89,7 @@ const main = () => {
const apiClientCode = codeGenerator.generateCode([
{
generator: () => {
return [`import { Schemas } from "./types";`];
return [`import { Schemas, Responses } from "./types";`];
},
},
codeGenerator.getAdditionalTypeDefinitionCustomCodeGenerator(),
Expand Down

0 comments on commit 819f22f

Please sign in to comment.