From 3b36e02b14faab56091c7bfdfc380847c2113119 Mon Sep 17 00:00:00 2001 From: Benjamin Giles Date: Tue, 21 Apr 2020 19:01:03 -0700 Subject: [PATCH] Minor changes to README, ensure docs are up to date --- packages/@aws-cdk/aws-apigateway/README.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/@aws-cdk/aws-apigateway/README.md b/packages/@aws-cdk/aws-apigateway/README.md index 3db3660d6c945..08d1629318045 100644 --- a/packages/@aws-cdk/aws-apigateway/README.md +++ b/packages/@aws-cdk/aws-apigateway/README.md @@ -62,12 +62,10 @@ book.addMethod('DELETE'); Optionally, you can import a Swagger/OpenAPI definition, and API Gateway will create resources and methods from your specification: -``` -const api = apigateway.RestApi.fromAPIDefinition( - this, - 'books-api', - apigateway.APIDefinition.fromAsset('path-to-your-swagger-file.json') -); +```ts +const api = new apigateway.APIDefinitionRestApi(this, 'books-api', { + apiDefinition: apigateway.APIDefinition.fromAsset('path-to-your-swagger-file.json') +}); ``` [API Gateway Swagger/OpenAPI import limitations](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-known-issues.html) apply when creating a Rest API in this way.