File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -308,7 +308,8 @@ const proxiesSchemas = {
308308 eventBusName : stringOrRef . required ( ) ,
309309 source : eventBridgeSource . required ( ) ,
310310 detailType : eventBridgeDetailType ,
311- detail : eventBridgeDetail
311+ detail : eventBridgeDetail ,
312+ request
312313 } )
313314 } )
314315}
Original file line number Diff line number Diff line change @@ -2271,5 +2271,26 @@ describe('#validateServiceProxies()', () => {
22712271
22722272 expect ( ( ) => serverlessApigatewayServiceProxy . validateServiceProxies ( ) ) . to . not . throw ( )
22732273 } )
2274+
2275+ it ( 'should throw error if eventbridge request is missing the template property' , ( ) => {
2276+ serverlessApigatewayServiceProxy . serverless . service . custom = {
2277+ apiGatewayServiceProxies : [
2278+ {
2279+ eventbridge : {
2280+ eventBusName : 'yourBus' ,
2281+ source : 'proxy.apigw' ,
2282+ path : 'eventbridge' ,
2283+ method : 'post' ,
2284+ request : { xxx : { 'application/json' : 'mappingTemplate' } }
2285+ }
2286+ }
2287+ ]
2288+ }
2289+
2290+ expect ( ( ) => serverlessApigatewayServiceProxy . validateServiceProxies ( ) ) . to . throw (
2291+ serverless . classes . Error ,
2292+ 'child "eventbridge" fails because [child "request" fails because [child "template" fails because ["template" is required]]]'
2293+ )
2294+ } )
22742295 } )
22752296} )
You can’t perform that action at this time.
0 commit comments