diff --git a/src/Internal/Schema/SingleCastUnionToType.php b/src/Internal/Schema/SingleCastUnionToType.php index d365073..453907a 100644 --- a/src/Internal/Schema/SingleCastUnionToType.php +++ b/src/Internal/Schema/SingleCastUnionToType.php @@ -150,7 +150,7 @@ public static function generate(BuilderFactory $builderFactory, string $pathPref 'hydrateObject', [ $builderFactory->classConstFetch( - $classString->relative, + $classString->fullyQualified->source, 'class', ), $builderFactory->var('value'), diff --git a/src/Internal/UnionTypeUtils.php b/src/Internal/UnionTypeUtils.php index d373d96..42b1275 100644 --- a/src/Internal/UnionTypeUtils.php +++ b/src/Internal/UnionTypeUtils.php @@ -26,7 +26,7 @@ public static function buildUnionType(Representation\Namespaced\Property\Type $t 'string' => $typeInUnion->payload, 'array' => 'array', 'object' => match ($typeInUnion->payload::class) { - Representation\Namespaced\Schema::class => $typeInUnion->payload->className->relative, + Representation\Namespaced\Schema::class => $typeInUnion->payload->className->fullyQualified->source, Representation\Namespaced\Property\Type::class => self::buildUnionType($typeInUnion->payload), }, };