From cc477ef4f15100a94af8582e3eeb03a3d505bc3d Mon Sep 17 00:00:00 2001 From: John Shaskin Date: Wed, 27 Mar 2019 12:58:32 -0600 Subject: [PATCH] Correct typo in README, and add some comments into code sample. --- packages/@aws-cdk/aws-apigateway/README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/@aws-cdk/aws-apigateway/README.md b/packages/@aws-cdk/aws-apigateway/README.md index bac1284691bab..ff80b34ead5f2 100644 --- a/packages/@aws-cdk/aws-apigateway/README.md +++ b/packages/@aws-cdk/aws-apigateway/README.md @@ -153,6 +153,7 @@ and/or payloads returned to a client from a method. A model may be added to a REST API as follows: ```ts +// Direct addition to REST API const beerModel = api.addModel('Beer', 'application/json', { $schema: 'http://json-schema.org/draft-04/schema#', title: 'Beer', @@ -164,8 +165,9 @@ const beerModel = api.addModel('Beer', 'application/json', { ibu: { type: 'number' }, }, }, - 'Simple for defining a beer.'); + 'Simple model for defining a beer.'); +// Separate instantiation const breweryModel = new apiGateway.Model(this, 'breweryModel', { restApi: api, name: 'Brewery', @@ -178,6 +180,7 @@ const breweryModel = new apiGateway.Model(this, 'breweryModel', { properties: { name: { type: 'string' }, address: { type: 'string' }, + // Reference another model beers: { type: 'array', items: { $ref: beerModel.referenceForSchema } } }, },