Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion samtranslator/swagger/swagger.py
Original file line number Diff line number Diff line change
Expand Up @@ -1134,7 +1134,8 @@ def add_request_parameters_to_method(self, path, method_name, request_parameters

parameter_name = request_parameter["Name"]
location_name = parameter_name.replace("method.request.", "")
location, name = location_name.split(".")

location, name = location_name.split(".", 1)

if location == "querystring":
location = "query"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ Resources:
RequestParameters:
- method.request.querystring.type
- method.request.path.id
- method.request.querystring.full.type
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@
}
}
},
"ServerlessRestApiDeploymentc2741b5220": {
"ServerlessRestApiDeployment32042a0513": {
"Type": "AWS::ApiGateway::Deployment",
"Properties": {
"RestApiId": {
"Ref": "ServerlessRestApi"
},
"Description": "RestApi deployment id: c2741b5220c940a753e3d1e18da6763aaba1c19b",
"Description": "RestApi deployment id: 32042a0513cd1c4e5c14794b306c4de10ca5c4af",
"StageName": "Stage"
}
},
Expand Down Expand Up @@ -118,7 +118,7 @@
"Type": "AWS::ApiGateway::Stage",
"Properties": {
"DeploymentId": {
"Ref": "ServerlessRestApiDeploymentc2741b5220"
"Ref": "ServerlessRestApiDeployment32042a0513"
},
"RestApiId": {
"Ref": "ServerlessRestApi"
Expand Down Expand Up @@ -247,6 +247,12 @@
"type": "string",
"name": "id",
"in": "path"
},
{
"required": false,
"type": "string",
"name": "full.type",
"in": "query"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@
}
}
},
"ServerlessRestApiDeployment7c706bcd56": {
"ServerlessRestApiDeploymentbe3a929cf9": {
"Type": "AWS::ApiGateway::Deployment",
"Properties": {
"RestApiId": {
"Ref": "ServerlessRestApi"
},
"Description": "RestApi deployment id: 7c706bcd56e685afb5882e0219515c9413bcd13b",
"Description": "RestApi deployment id: be3a929cf90555789f2865fc4a96eb9a11ff7a81",
"StageName": "Stage"
}
},
Expand Down Expand Up @@ -128,7 +128,7 @@
"Type": "AWS::ApiGateway::Stage",
"Properties": {
"DeploymentId": {
"Ref": "ServerlessRestApiDeployment7c706bcd56"
"Ref": "ServerlessRestApiDeploymentbe3a929cf9"
},
"RestApiId": {
"Ref": "ServerlessRestApi"
Expand Down Expand Up @@ -247,6 +247,12 @@
"type": "string",
"name": "id",
"in": "path"
},
{
"required": false,
"type": "string",
"name": "full.type",
"in": "query"
}
]
}
Expand Down
14 changes: 10 additions & 4 deletions tests/translator/output/function_with_request_parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@
}
}
},
"ServerlessRestApiDeployment2223b43914": {
"ServerlessRestApiDeployment104b236830": {
"Type": "AWS::ApiGateway::Deployment",
"Properties": {
"RestApiId": {
"Ref": "ServerlessRestApi"
},
"Description": "RestApi deployment id: 2223b439142974b7a3aad1381ddd39027077ce52",
"Description": "RestApi deployment id: 104b236830d26d2515909073d13fa9c58ad6db49",
"StageName": "Stage"
}
},
Expand Down Expand Up @@ -118,7 +118,7 @@
"Type": "AWS::ApiGateway::Stage",
"Properties": {
"DeploymentId": {
"Ref": "ServerlessRestApiDeployment2223b43914"
"Ref": "ServerlessRestApiDeployment104b236830"
},
"RestApiId": {
"Ref": "ServerlessRestApi"
Expand Down Expand Up @@ -239,6 +239,12 @@
"type": "string",
"name": "id",
"in": "path"
},
{
"required": false,
"type": "string",
"name": "full.type",
"in": "query"
}
]
}
Expand Down Expand Up @@ -272,4 +278,4 @@
}
}
}
}
}