Skip to content

Commit 5b7a07c

Browse files
committed
docs: update README
- Updates the example to instantiate `RestApiWithSpec` in README so that the constructor is used instead of the obsolete factory method. - Bumps the version tag to `v0.2.0`.
1 parent bac7bbb commit 5b7a07c

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

README.ja.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
このレポジトリを依存関係(`dependencies`)に追加してください。
2222

2323
```sh
24-
npm install https://github.com/codemonger-io/cdk-rest-api-with-spec.git#v0.1.1
24+
npm install https://github.com/codemonger-io/cdk-rest-api-with-spec.git#v0.2.0
2525
```
2626

2727
このライブラリはCDK v2プロジェクトで使用することを想定しており、以下のモジュールは`dependencies`ではなく`peerDependencies`に含んでいます。
@@ -32,11 +32,10 @@ CDK v2プロジェクトで使っている限り、これらを別途インス
3232

3333
## 始める
3434

35-
[`aws_apigateway.RestApi`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.RestApi.html)のコンストラクタの代わりに[`RestApiWithSpec.createRestApi`](./api-docs/markdown/cdk-rest-api-with-spec.restapiwithspec.createrestapi.md)を使ってください。
36-
この関数は[`aws_apigateway.RestApi`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.RestApi.html)をOpenAPI定義を記述する機能で拡張したオブジェクトを返します。
35+
[`aws_apigateway.RestApi`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.RestApi.html)の代わりに[`RestApiWithSpec`](./api-docs/markdown/cdk-rest-api-with-spec.restapiwithspec.md)をインスタンス化してください。
3736

3837
```ts
39-
const api = RestApiWithSpec.createRestApi(this, 'example-api', {
38+
const api = new RestApiWithSpec(this, 'example-api', {
4039
description: 'Example of RestApiWithSpec',
4140
openApiInfo: {
4241
version: '0.0.1',

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ This library is implemented for the CDK **version 2** (CDK v2) and does not work
2121
Please add this repository to your dependencies.
2222

2323
```sh
24-
npm install https://github.com/codemonger-io/cdk-rest-api-with-spec.git#v0.1.1
24+
npm install https://github.com/codemonger-io/cdk-rest-api-with-spec.git#v0.2.0
2525
```
2626

2727
This library is supposed to be used in a CDK v2 project, so it does not include the following modules in the `dependencies` but does in the `peerDependencies`.
@@ -32,11 +32,10 @@ As long as you are working on a CDK v2 project, you should not have to separatel
3232

3333
## Getting started
3434

35-
Please use [`RestApiWithSpec.createRestApi`](./api-docs/markdown/cdk-rest-api-with-spec.restapiwithspec.createrestapi.md) instead of the constructor of [`aws_apigateway.RestApi`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.RestApi.html).
36-
This function will return an object which augments [`aws_apigateway.RestApi`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.RestApi.html) with the features to describe the OpenAPI definition.
35+
Please instantiate [`RestApiWithSpec`](./api-docs/markdown/cdk-rest-api-with-spec.restapiwithspec.md) instead of [`aws_apigateway.RestApi`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.RestApi.html).
3736

3837
```ts
39-
const api = RestApiWithSpec.createRestApi(this, 'example-api', {
38+
const api = new RestApiWithSpec(this, 'example-api', {
4039
description: 'Example of RestApiWithSpec',
4140
openApiInfo: {
4241
version: '0.0.1',

0 commit comments

Comments
 (0)