File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -278,7 +278,8 @@ const proxiesSchemas = {
278278 tableName : stringOrRef . required ( ) ,
279279 condition : Joi . string ( ) ,
280280 hashKey : dynamodbDefaultKeyScheme . required ( ) ,
281- rangeKey : dynamodbDefaultKeyScheme
281+ rangeKey : dynamodbDefaultKeyScheme ,
282+ request
282283 } )
283284 } ) ,
284285 eventbridge : Joi . object ( {
Original file line number Diff line number Diff line change @@ -2169,5 +2169,24 @@ describe('#validateServiceProxies()', () => {
21692169
21702170 expect ( ( ) => serverlessApigatewayServiceProxy . validateServiceProxies ( ) ) . to . not . throw ( )
21712171 } )
2172+
2173+ it ( 'should not throw error if request is a mapping template object' , ( ) => {
2174+ serverlessApigatewayServiceProxy . serverless . service . custom = {
2175+ apiGatewayServiceProxies : [
2176+ {
2177+ dynamodb : {
2178+ tableName : 'yourTable' ,
2179+ path : 'dynamodb' ,
2180+ method : 'put' ,
2181+ action : 'PutItem' ,
2182+ hashKey : { pathParam : 'id' , attributeType : 'S' } ,
2183+ request : { template : { 'application/json' : 'mapping template' } }
2184+ }
2185+ }
2186+ ]
2187+ }
2188+
2189+ expect ( ( ) => serverlessApigatewayServiceProxy . validateServiceProxies ( ) ) . to . not . throw ( )
2190+ } )
21722191 } )
21732192} )
You can’t perform that action at this time.
0 commit comments