You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+38-21Lines changed: 38 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -350,6 +350,24 @@ cookieParams:
350
350
type: "string"
351
351
```
352
352
353
+
#### `headerParams` - Request Headers
354
+
355
+
Request Headers can be described as follow:
356
+
357
+
* `name`: the name of the query variable
358
+
* `description`: a description of the query variable
359
+
* `required`: whether the query parameter is mandatory (boolean)
360
+
* `schema`: JSON schema (inline, file or externally hosted)
361
+
362
+
```yml
363
+
headerParams:
364
+
- name: "Content-Type"
365
+
description: "The content type"
366
+
required: true
367
+
schema:
368
+
type: "string"
369
+
```
370
+
353
371
#### `requestModels`
354
372
355
373
The `requestModels` property allows you to define models for the HTTP Request of the function event. You can define a different model for each different `Content-Type`. You can define a reference to the relevant request model named in the `models` section of your configuration (see [Defining Models](#models) section).
@@ -369,14 +387,24 @@ For an example of a `methodResponses` configuration for an event see below:
369
387
```yml
370
388
methodResponse:
371
389
- statusCode: 200
372
-
responseHeaders:
373
-
- name: "Content-Type"
374
-
description: "Content Type header"
375
-
schema:
376
-
type: "string"
390
+
responseBody:
391
+
description: Success
377
392
responseModels:
378
393
application/json: "CreateResponse"
379
394
application/xml: "CreateResponseXML"
395
+
responseHeaders:
396
+
X-Rate-Limit-Limit:
397
+
description: The number of allowed requests in the current period
398
+
schema:
399
+
type: integer
400
+
X-Rate-Limit-Remaining:
401
+
description: The number of remaining requests in the current period
402
+
schema:
403
+
type: integer
404
+
X-Rate-Limit-Reset:
405
+
description: The number of seconds left in the current period
406
+
schema:
407
+
type: integer
380
408
```
381
409
382
410
##### `responseModels`
@@ -389,27 +417,16 @@ responseModels:
389
417
application/xml: "CreateResponseXML"
390
418
```
391
419
392
-
##### `responseHeaders` and `requestHeaders`
393
-
394
-
The `responseHeaders/requestHeaders` section of the configuration allows you to define the HTTP headers for the function event.
420
+
##### `responseHeaders`
395
421
396
-
The attributes for a header are as follow:
397
-
398
-
* `name`: the name of the HTTP Header
399
-
* `description`: a description of the HTTP Header
400
-
* `schema`: JSON schema (inline, file or externally hosted)
422
+
The `responseHeaders` property allows you to define the headers expected in a HTTP Response of the function event. This should only contain a description and a schema, which must be a JSON schema (inline, file or externally hosted).
401
423
402
424
```yml
403
425
responseHeaders:
404
-
- name: "Content-Type"
405
-
description: "Content Type header"
426
+
X-Rate-Limit-Limit:
427
+
description: The number of allowed requests in the current period
0 commit comments