Skip to content

Commit

Permalink
Respect "flattened" parameter wrt query serialization field names
Browse files Browse the repository at this point in the history
  • Loading branch information
jeskew committed Jun 18, 2015
1 parent d62abf0 commit 6f66fe3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Api/Serializer/QueryParamBuilder.php
Expand Up @@ -16,7 +16,15 @@ class QueryParamBuilder

protected function queryName(Shape $shape, $default = null)
{
return $shape['queryName'] ?: $default;
if (null !== $shape['queryName']) {
return $shape['queryName'];
}

if ($this->isFlat($shape) && !empty($shape['member']['locationName'])) {
return $shape['member']['locationName'];
}

return $default;
}

protected function isFlat(Shape $shape)
Expand Down

0 comments on commit 6f66fe3

Please sign in to comment.