-
Notifications
You must be signed in to change notification settings - Fork 0
/
api_gateway_definition.yml
114 lines (114 loc) · 4.81 KB
/
api_gateway_definition.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
---
swagger: "2.0"
info:
version: "2021-08-26T18:55:50Z"
schemes:
- "https"
paths:
/archiver:
post:
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- name: "workId"
in: "query"
required: true
type: "string"
- name: "width"
in: "query"
required: false
type: "string"
- name: "email"
in: "query"
required: true
type: "string"
responses:
"200":
description: "200 response"
schema:
$ref: "#/definitions/Empty"
headers:
Access-Control-Allow-Origin:
type: "string"
x-amazon-apigateway-request-validator:
"Validate query string parameters and\
\ headers"
x-amazon-apigateway-integration:
type: "aws"
httpMethod: "POST"
uri: "arn:aws:apigateway:${aws_region}:lambda:path/2015-03-31/functions/${lambda_arn}/invocations"
responses:
default:
statusCode: "200"
responseParameters:
method.response.header.Access-Control-Allow-Origin: "'*'"
requestParameters:
integration.request.header.X-Amz-Invocation-Type: "'Event'"
requestTemplates:
application/json:
"## See http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html\n\
## This template will pass through all parameters including path, querystring,\
\ header, stage variables, and context through to the integration endpoint\
\ via the body/payload\n#set($allParams = $input.params())\n{\n\"body-json\"\
\ : $input.json('$'),\n\"params\" : {\n#foreach($type in $allParams.keySet())\n\
\ #set($params = $allParams.get($type))\n\"$type\" : {\n #foreach($paramName\
\ in $params.keySet())\n \"$paramName\" : \"$util.escapeJavaScript($params.get($paramName))\"\
\n #if($foreach.hasNext),#end\n #end\n}\n #if($foreach.hasNext),#end\n\
#end\n},\n\"stage-variables\" : {\n#foreach($key in $stageVariables.keySet())\n\
\"$key\" : \"$util.escapeJavaScript($stageVariables.get($key))\"\n \
\ #if($foreach.hasNext),#end\n#end\n},\n\"context\" : {\n \"account-id\"\
\ : \"$context.identity.accountId\",\n \"api-id\" : \"$context.apiId\"\
,\n \"api-key\" : \"$context.identity.apiKey\",\n \"authorizer-principal-id\"\
\ : \"$context.authorizer.principalId\",\n \"caller\" : \"$context.identity.caller\"\
,\n \"cognito-authentication-provider\" : \"$context.identity.cognitoAuthenticationProvider\"\
,\n \"cognito-authentication-type\" : \"$context.identity.cognitoAuthenticationType\"\
,\n \"cognito-identity-id\" : \"$context.identity.cognitoIdentityId\"\
,\n \"cognito-identity-pool-id\" : \"$context.identity.cognitoIdentityPoolId\"\
,\n \"http-method\" : \"$context.httpMethod\",\n \"stage\" : \"\
$context.stage\",\n \"source-ip\" : \"$context.identity.sourceIp\"\
,\n \"user\" : \"$context.identity.user\",\n \"user-agent\" : \"\
$context.identity.userAgent\",\n \"user-arn\" : \"$context.identity.userArn\"\
,\n \"request-id\" : \"$context.requestId\",\n \"resource-id\" :\
\ \"$context.resourceId\",\n \"resource-path\" : \"$context.resourcePath\"\
\n }\n}\n"
passthroughBehavior: "when_no_templates"
contentHandling: "CONVERT_TO_TEXT"
options:
consumes:
- "application/json"
produces:
- "application/json"
responses:
"200":
description: "200 response"
schema:
$ref: "#/definitions/Empty"
headers:
Access-Control-Allow-Origin:
type: "string"
Access-Control-Allow-Methods:
type: "string"
Access-Control-Allow-Headers:
type: "string"
x-amazon-apigateway-integration:
responses:
default:
statusCode: "200"
responseParameters:
method.response.header.Access-Control-Allow-Methods: "'OPTIONS,POST'"
method.response.header.Access-Control-Allow-Headers: "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token'"
method.response.header.Access-Control-Allow-Origin: "'*'"
requestTemplates:
application/json: '{"statusCode": 200}'
passthroughBehavior: "when_no_match"
type: "mock"
definitions:
Empty:
type: "object"
title: "Empty Schema"
x-amazon-apigateway-request-validators:
Validate query string parameters and headers:
validateRequestParameters: true
validateRequestBody: false