Skip to content

Commit 5d46b40

Browse files
committed
Create properties of type mixed if required and not exists
1 parent 3f574f3 commit 5d46b40

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Type/PopulateRequired.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ public function populateRequired(string $key): void
2727
switch (true) {
2828
case \is_scalar($this->$key):
2929
break;
30+
case $this instanceof ObjectType && ! isset($this->properties[$requiredName]):
31+
$this->properties[$requiredName] = new TypeSet(MixedType::fromDefinition([], $requiredName));
32+
$this->properties[$requiredName]->setIsRequired(true);
33+
break;
3034
case $this->$key[$requiredName] instanceof RequiredAware:
3135
$this->$key[$requiredName]->setIsRequired(true);
3236
break;

0 commit comments

Comments
 (0)