/
api_merge_definitions_with_conflicting_request_models.yaml
67 lines (63 loc) · 1.53 KB
/
api_merge_definitions_with_conflicting_request_models.yaml
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
Transform: AWS::Serverless-2016-10-31
Resources:
MyApi:
Type: AWS::Serverless::Api
Properties:
StageName: Prod
Models:
User:
type: object
properties:
username:
type: string
DefinitionBody:
swagger: '2.0'
info:
title: Example
version: '1'
paths:
/test:
get:
parameters:
- name: proxy
in: path
responses:
'200':
description: Success
MergeDefinitions: true
Auth:
Authorizers:
MyAuthorizer:
UserPoolArn: !GetAtt MyCognitoUserPool.Arn
MyFunction:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs18.x
InlineCode: |
exports.handler = async (event, context, callback) => {
return {
statusCode: 200,
body: 'Success'
}
}
Events:
MyEventV1:
Type: Api
Properties:
RestApiId: !Ref MyApi
Path: /test
Method: get
Auth:
Authorizer: MyAuthorizer
RequestModel:
Model: User
Required: true
RequestParameters:
- method.request.querystring.type:
Required: true
Caching: true
MyCognitoUserPool:
Type: AWS::Cognito::UserPool
Properties:
UserPoolName: MyCognitoUserPoolRandomName