Skip to content

Commit

Permalink
Merge pull request aws#696 from jeskew/fix/query-maps-with-location-n…
Browse files Browse the repository at this point in the history
…ames

Use the locationName in query serialization if present
  • Loading branch information
jeskew committed Jul 17, 2015
2 parents 1a69410 + 0799f05 commit b5212b6
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Api/Serializer/QueryParamBuilder.php
Expand Up @@ -20,6 +20,10 @@ protected function queryName(Shape $shape, $default = null)
return $shape['queryName'];
}

if (null !== $shape['locationName']) {
return $shape['locationName'];
}

if ($this->isFlat($shape) && !empty($shape['member']['locationName'])) {
return $shape['member']['locationName'];
}
Expand Down
51 changes: 51 additions & 0 deletions tests/Api/test_cases/protocols/input/query.json
Expand Up @@ -288,6 +288,57 @@
}
]
},
{
"description": "Serialize map type with locationName",
"metadata": {
"protocol": "query",
"apiVersion": "2014-01-01"
},
"shapes": {
"InputShape": {
"type": "structure",
"members": {
"MapArg": {
"shape": "StringMap"
}
}
},
"StringMap": {
"type": "map",
"key": {
"shape": "StringType",
"locationName": "TheKey"
},
"value": {
"shape": "StringType",
"locationName": "TheValue"
}
},
"StringType": {
"type": "string"
}
},
"cases": [
{
"given": {
"input": {
"shape": "InputShape"
},
"name": "OperationName"
},
"params": {
"MapArg": {
"key1": "val1",
"key2": "val2"
}
},
"serialized": {
"uri": "/",
"body": "Action=OperationName&Version=2014-01-01&MapArg.entry.1.TheKey=key1&MapArg.entry.1.TheValue=val1&MapArg.entry.2.TheKey=key2&MapArg.entry.2.TheValue=val2"
}
}
]
},
{
"description": "Base64 encoded Blobs",
"metadata": {
Expand Down

0 comments on commit b5212b6

Please sign in to comment.