-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswagger.yml
More file actions
134 lines (131 loc) · 4.06 KB
/
swagger.yml
File metadata and controls
134 lines (131 loc) · 4.06 KB
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# Swagger file describing Reservation-API
swagger: '2.0'
basepath: /prod
info:
version: "0.0.0"
title: Reservation-API
schemes:
- https
securityDefinitions:
Reservation-Users:
type: apiKey
name: Authorization
in: header
x-amazon-apigateway-authtype: cognito_user_pools
x-amazon-apigateway-authorizer:
type: cognito_user_pools
providerARNs:
- <<YOUR_COGNITO_USER_POOL_ARN>>
paths:
/:
x-amazon-apigateway-any-method:
produces:
- application/json
responses:
200:
description: Successful response
schema:
title: ArrayOfReservations
type: array
items:
title: Reservation
type: object
properties:
startTime:
type: string
userName:
type: string
x-amazon-apigateway-integration:
responses:
default:
statusCode: 200
uri: arn:aws:apigateway:<<YOUR_REGION>>:lambda:path/2015-03-31/functions/arn:aws:lambda:<<YOUR_REGION>>:<<YOUR_ACCOUNT_ID>>:function:${stageVariables.LambdaFunctionName}/invocations
passthroughBehavior: when_no_match
httpMethod: POST
type: aws_proxy
security:
- Reservation-Users: []
options:
summary: CORS support
description: |
Enable CORS by returning correct headers
consumes:
- application/json
produces:
- application/json
tags:
- CORS
x-amazon-apigateway-integration:
type: mock
requestTemplates:
application/json: |
{
"statusCode" : 200
}
responses:
default:
statusCode: "200"
responseParameters:
method.response.header.Access-Control-Allow-Headers : "'Content-Type,X-AmzDate,Authorization,X-Api-Key'"
method.response.header.Access-Control-Allow-Methods : "'DELETE,GET,OPTIONS,PUT'"
method.response.header.Access-Control-Allow-Origin : "'*'"
responseTemplates:
application/json: "{\"statusCode\": 200}"
responses:
200:
description: Default response for CORS method
headers:
Access-Control-Allow-Headers:
type: "string"
Access-Control-Allow-Methods:
type: "string"
Access-Control-Allow-Origin:
type: "string"
/{proxy+}:
x-amazon-apigateway-any-method:
produces:
- application/json
parameters:
- name: proxy
in: path
required: true
type: string
responses: {}
x-amazon-apigateway-integration:
uri: arn:aws:apigateway:<<YOUR_REGION>>:lambda:path/2015-03-31/functions/arn:aws:lambda:<<YOUR_REGION>>:<<YOUR_ACCOUNT_ID>>:function:${stageVariables.LambdaFunctionName}/invocations
httpMethod: POST
type: aws_proxy
security:
- Reservation-Users: []
options:
summary: CORS support
description: |
Enable CORS by returning correct headers
consumes:
- application/json
produces:
- application/json
tags:
- CORS
x-amazon-apigateway-integration:
type: mock
requestTemplates:
application/json: "{ \"statusCode\" : 200 }"
responses:
default:
statusCode: "200"
responseParameters:
method.response.header.Access-Control-Allow-Headers : "'Content-Type,X-AmzDate,Authorization,X-Api-Key'"
method.response.header.Access-Control-Allow-Methods : "'DELETE,GET,OPTIONS,PUT'"
method.response.header.Access-Control-Allow-Origin : "'*'"
passthroughBehavior: when_no_match
responses:
200:
description: Default response for CORS method
headers:
Access-Control-Allow-Headers:
type: "string"
Access-Control-Allow-Methods:
type: "string"
Access-Control-Allow-Origin:
type: "string"