@@ -895,11 +895,11 @@ describe('#validateServiceProxies()', () => {
895
895
)
896
896
}
897
897
898
- const shouldSucceed = ( key , value ) => {
898
+ const shouldSucceed = ( key , value , ... missing ) => {
899
899
serverlessApigatewayServiceProxy . serverless . service . custom = {
900
900
apiGatewayServiceProxies : [
901
901
{
902
- s3 : getProxy ( key , value )
902
+ s3 : getProxy ( key , value , ... missing )
903
903
}
904
904
]
905
905
}
@@ -1026,6 +1026,34 @@ describe('#validateServiceProxies()', () => {
1026
1026
it ( 'should not throw if requestParameters is a string to string mapping' , ( ) => {
1027
1027
shouldSucceed ( 'requestParameters' , { key1 : 'value1' , key2 : 'value2' } )
1028
1028
} )
1029
+
1030
+ it ( 'should throw if requestParameters has "integration.request.path.object" and key is defined' , ( ) => {
1031
+ shouldError (
1032
+ 'child "s3" fails because [child "key" fails because ["key" is not allowed]]' ,
1033
+ 'requestParameters' ,
1034
+ {
1035
+ 'integration.request.path.object' : 'context.requestId' ,
1036
+ 'integration.request.header.cache-control' : "'public, max-age=31536000, immutable'"
1037
+ }
1038
+ )
1039
+ } )
1040
+
1041
+ it ( 'should not throw if requestParameters has "integration.request.path.object" and key is not defined' , ( ) => {
1042
+ shouldSucceed (
1043
+ 'requestParameters' ,
1044
+ {
1045
+ 'integration.request.path.object' : 'context.requestId' ,
1046
+ 'integration.request.header.cache-control' : "'public, max-age=31536000, immutable'"
1047
+ } ,
1048
+ 'key'
1049
+ )
1050
+ } )
1051
+
1052
+ it ( `should not throw if requestParameters doesn't have "integration.request.path.object" and key is defined` , ( ) => {
1053
+ shouldSucceed ( 'requestParameters' , {
1054
+ 'integration.request.header.cache-control' : "'public, max-age=31536000, immutable'"
1055
+ } )
1056
+ } )
1029
1057
} )
1030
1058
1031
1059
describe ( 'sns' , ( ) => {
0 commit comments