File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Expand file tree Collapse file tree 2 files changed +25
-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 @@ -2272,4 +2272,27 @@ describe('#validateServiceProxies()', () => {
22722272 expect ( ( ) => serverlessApigatewayServiceProxy . validateServiceProxies ( ) ) . to . not . throw ( )
22732273 } )
22742274 } )
2275+
2276+ describe ( 'eventbridge' , ( ) => {
2277+ it ( 'should throw error if eventbridge request is missing the template property' , ( ) => {
2278+ serverlessApigatewayServiceProxy . serverless . service . custom = {
2279+ apiGatewayServiceProxies : [
2280+ {
2281+ eventbridge : {
2282+ eventBusName : 'yourBus' ,
2283+ source : 'proxy.apigw' ,
2284+ path : 'eventbridge' ,
2285+ method : 'post' ,
2286+ request : { xxx : { 'application/json' : 'mappingTemplate' } }
2287+ }
2288+ }
2289+ ]
2290+ }
2291+
2292+ expect ( ( ) => serverlessApigatewayServiceProxy . validateServiceProxies ( ) ) . to . throw (
2293+ serverless . classes . Error ,
2294+ 'child "eventbridge" fails because [child "request" fails because [child "template" fails because ["template" is required]]]'
2295+ )
2296+ } )
2297+ } )
22752298} )
You can’t perform that action at this time.
0 commit comments