APIGateway: adds request parameters to Method resource (#5425)
This commit is contained in:
parent
0c9906c5bb
commit
257d775dfb
@ -190,7 +190,7 @@ class Method(CloudFormationModel, dict):
|
||||
authorizerId=kwargs.get("authorizer_id"),
|
||||
authorizationScopes=kwargs.get("authorization_scopes"),
|
||||
apiKeyRequired=kwargs.get("api_key_required") or False,
|
||||
requestParameters=None,
|
||||
requestParameters=kwargs.get("request_parameters"),
|
||||
requestModels=kwargs.get("request_models"),
|
||||
methodIntegration=None,
|
||||
operationName=kwargs.get("operation_name"),
|
||||
@ -342,6 +342,7 @@ class Resource(CloudFormationModel):
|
||||
method_type,
|
||||
authorization_type,
|
||||
api_key_required,
|
||||
request_parameters=None,
|
||||
request_models=None,
|
||||
operation_name=None,
|
||||
authorizer_id=None,
|
||||
@ -354,6 +355,7 @@ class Resource(CloudFormationModel):
|
||||
method_type=method_type,
|
||||
authorization_type=authorization_type,
|
||||
api_key_required=api_key_required,
|
||||
request_parameters=request_parameters,
|
||||
request_models=request_models,
|
||||
operation_name=operation_name,
|
||||
authorizer_id=authorizer_id,
|
||||
@ -1409,6 +1411,7 @@ class APIGatewayBackend(BaseBackend):
|
||||
method_type,
|
||||
authorization_type,
|
||||
api_key_required=None,
|
||||
request_parameters=None,
|
||||
request_models=None,
|
||||
operation_name=None,
|
||||
authorizer_id=None,
|
||||
@ -1420,6 +1423,7 @@ class APIGatewayBackend(BaseBackend):
|
||||
method_type,
|
||||
authorization_type,
|
||||
api_key_required=api_key_required,
|
||||
request_parameters=request_parameters,
|
||||
request_models=request_models,
|
||||
operation_name=operation_name,
|
||||
authorizer_id=authorizer_id,
|
||||
|
@ -190,6 +190,7 @@ class APIGatewayResponse(BaseResponse):
|
||||
authorizer_id = self._get_param("authorizerId")
|
||||
authorization_scopes = self._get_param("authorizationScopes")
|
||||
request_validator_id = self._get_param("requestValidatorId")
|
||||
request_parameters = self._get_param("requestParameters")
|
||||
method = self.backend.put_method(
|
||||
function_id,
|
||||
resource_id,
|
||||
@ -197,6 +198,7 @@ class APIGatewayResponse(BaseResponse):
|
||||
authorization_type,
|
||||
api_key_required,
|
||||
request_models=request_models,
|
||||
request_parameters=request_parameters,
|
||||
operation_name=operation_name,
|
||||
authorizer_id=authorizer_id,
|
||||
authorization_scopes=authorization_scopes,
|
||||
|
@ -354,7 +354,11 @@ def test_create_method():
|
||||
]["id"]
|
||||
|
||||
client.put_method(
|
||||
restApiId=api_id, resourceId=root_id, httpMethod="GET", authorizationType="none"
|
||||
restApiId=api_id,
|
||||
resourceId=root_id,
|
||||
httpMethod="GET",
|
||||
authorizationType="none",
|
||||
requestParameters={"method.request.header.InvocationType": True},
|
||||
)
|
||||
|
||||
response = client.get_method(restApiId=api_id, resourceId=root_id, httpMethod="GET")
|
||||
@ -368,6 +372,7 @@ def test_create_method():
|
||||
"authorizationType": "none",
|
||||
"apiKeyRequired": False,
|
||||
"methodResponses": {},
|
||||
"requestParameters": {"method.request.header.InvocationType": True},
|
||||
"ResponseMetadata": {"HTTPStatusCode": 200},
|
||||
}
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user