-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for MethodResponse to aws-apigateway.
Remove Dockerfile that was no longer needed Update python base image from 3.6 to 3.6.5 Make the dockerfile work Add MethodResponse support for aws-apigateway Remove Dockerfile that was no longer needed Update python base image from 3.6 to 3.6.5 Make the dockerfile work Add MethodResponse to API Gateway Method. Add some documentation to the MethodResponse properties. Update the test for MethodResponse with response models. Fix some formatting and finish adding code documentation for MethodResponse. Remove Dockerfile from this branch Fix bad merge to methodresponse test. Correct the MethodResponse response models documentation. Add IModel type to reference when configuring a MethodResponse Slight update to comments. Update API Gateway MethodResponse documentation. Author: John Shaskin <guitarjohnn@gmail.com> Date: Mon Feb 05 5:30:45 2019 +0100 Add some documentation around the referencing default Empty/Error models. Edit documentation around the referencing default Empty/Error models. Edit documentation around the referencing default Empty/Error models. Fix 'trailing whitespace' in comments
- Loading branch information
1 parent
bfa40b1
commit c9a77f5
Showing
5 changed files
with
186 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { IModel } from './model'; | ||
|
||
export interface MethodResponse { | ||
|
||
/** | ||
* The method response's status code, which you map to an IntegrationResponse. | ||
* Required. | ||
*/ | ||
statusCode: string; | ||
|
||
/** | ||
* Response parameters that API Gateway sends to the client that called a method. | ||
* Specify response parameters as key-value pairs (string-to-Boolean maps), with | ||
* a destination as the key and a Boolean as the value. Specify the destination | ||
* using the following pattern: method.response.header.name, where the name is a | ||
* valid, unique header name. The Boolean specifies whether a parameter is required. | ||
* @default None | ||
*/ | ||
responseParameters?: { [destination: string]: boolean }; | ||
|
||
/** | ||
* The resources used for the response's content type. Specify response models as | ||
* key-value pairs (string-to-string maps), with a content type as the key and a Model | ||
* resource name as the value. | ||
* @default None | ||
*/ | ||
responseModels?: { [contentType: string]: IModel }; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
export interface IModel { | ||
readonly modelId: string; | ||
} | ||
|
||
/** | ||
* Represents a reference to a REST API's Empty model, which is available | ||
* as part of the model collection by default. This can be used for mapping | ||
* JSON responses from an integration to what is returned to a client, | ||
* where strong typing is not required. In the absence of any defined | ||
* model, the Empty model will be used to return the response payload | ||
* unmapped. | ||
* | ||
* Definition | ||
* { | ||
* "$schema" : "http://json-schema.org/draft-04/schema#", | ||
* "title" : "Empty Schema", | ||
* "type" : "object" | ||
* } | ||
* | ||
* @see https://docs.amazonaws.cn/en_us/apigateway/latest/developerguide/models-mappings.html#models-mappings-models | ||
*/ | ||
export class EmptyModel implements IModel { | ||
public readonly modelId = 'Empty'; | ||
} | ||
|
||
/** | ||
* Represents a reference to a REST API's Error model, which is available | ||
* as part of the model collection by default. This can be used for mapping | ||
* error JSON responses from an integration to a client, where a simple | ||
* generic message field is sufficient to map and return an error payload. | ||
* | ||
* Definition | ||
* { | ||
* "$schema" : "http://json-schema.org/draft-04/schema#", | ||
* "title" : "Error Schema", | ||
* "type" : "object", | ||
* "properties" : { | ||
* "message" : { "type" : "string" } | ||
* } | ||
* } | ||
*/ | ||
export class ErrorModel implements IModel { | ||
public readonly modelId = 'Error'; | ||
} | ||
|
||
// TODO: Implement Model, enabling management of custom models. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters