Skip to content

Commit 88eb11c

Browse files
authored
Fix DocumentShape not initialized in constructor (#2056)
1 parent 42da778 commit 88eb11c

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/Generator/InputGenerator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ public function generate(Operation $operation): ClassName
213213
}
214214
} elseif ($memberShape instanceof DocumentShape) {
215215
$typeAlreadyNullable = true; // The type itself is already nullable
216+
$constructorBody .= strtr('$this->PROPERTY = $input["NAME"] ?? null;' . "\n", ['PROPERTY' => GeneratorHelper::normalizeName($member->getName()), 'NAME' => $member->getName()]);
216217
} elseif ($member->isStreaming()) {
217218
$parameterType = 'string|resource|(callable(int): string)|iterable<string>';
218219
$returnType = null;

0 commit comments

Comments
 (0)