Skip to content

Commit

Permalink
use any type as fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskapp committed Nov 3, 2024
1 parent 0798e38 commit 111244f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Generator/Type/GeneratorAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
use PSX\Schema\Generator\Normalizer\NormalizerInterface;
use PSX\Schema\Type\ArrayPropertyType;
use PSX\Schema\Type\BooleanPropertyType;
use PSX\Schema\Type\Factory\PropertyTypeFactory;
use PSX\Schema\Type\GenericPropertyType;
use PSX\Schema\Type\IntegerPropertyType;
use PSX\Schema\Type\MapPropertyType;
Expand Down Expand Up @@ -64,9 +65,9 @@ public function getType(PropertyTypeAbstract $type): string
} elseif ($type instanceof BooleanPropertyType) {
return $this->getBoolean();
} elseif ($type instanceof ArrayPropertyType) {
return $this->getArray($this->getType($type->getSchema()));
return $this->getArray($this->getType($type->getSchema() ?? PropertyTypeFactory::getAny()));
} elseif ($type instanceof MapPropertyType) {
return $this->getMap($this->getType($type->getSchema()));
return $this->getMap($this->getType($type->getSchema() ?? PropertyTypeFactory::getAny()));
} elseif ($type instanceof ReferencePropertyType) {
return $this->getReference($type->getTarget());
} elseif ($type instanceof GenericPropertyType) {
Expand Down

0 comments on commit 111244f

Please sign in to comment.