Skip to content

Commit f246c55

Browse files
authored
Avoid generating populator for the exception fields (#1501)
Some AWS services define the Message member of the exception shapes, even though it is part of the standard AWS exception representation already. We want to keep the message containing the full parsed information.
1 parent d4c0493 commit f246c55

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Generator/CodeGenerator/PopulatorGenerator.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,11 @@ private function generatePopulator(Operation $operation, StructureShape $shape,
177177
$nonHeaders = [];
178178
$body = '';
179179
foreach ($shape->getMembers() as $member) {
180+
// Avoid conflicts with PHP properties. Those AWS members are included in the AWSError anyway.
181+
if ($forException && \in_array(strtolower($member->getName()), ['code', 'message'])) {
182+
continue;
183+
}
184+
180185
if ('header' !== $member->getLocation()) {
181186
$nonHeaders[$member->getName()] = $member;
182187

0 commit comments

Comments
 (0)