Skip to content

Commit

Permalink
Correct typo in README, and add some comments into code sample.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-shaskin committed Mar 27, 2019
1 parent 3a4fd4f commit cc477ef
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/@aws-cdk/aws-apigateway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
Expand All @@ -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 } }
},
},
Expand Down

0 comments on commit cc477ef

Please sign in to comment.