You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/JsonSchema/Metadata/Property/Factory/SchemaPropertyMetadataFactory.php
+20-2Lines changed: 20 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -73,9 +73,27 @@ public function create(string $resourceClass, string $property, array $options =
73
73
// on output the serializer embeds the relation as soon as gen_id is false, even when it is not a readable link (see AbstractItemNormalizer::normalizeRelation())
// on output a non-resource object is serialized by the standard object normalizer, which embeds related resources regardless of readableLink (see AbstractItemNormalizer::supportsNormalization())
76
+
// on output a non-resource object is serialized by the standard object normalizer, which embeds non-resource properties regardless of readableLink (see AbstractItemNormalizer::supportsNormalization())
77
+
// For resource-typed properties however, the circular reference handler (see AbstractItemNormalizer::$defaultContext) may produce an IRI, so isReadableLink should determine the schema
77
78
if (!$isInput && !$this->isResourceClass($resourceClass)) {
78
-
$link = true;
79
+
if (method_exists(PropertyInfoExtractor::class, 'getType')) {
80
+
if (!$propertyMetadata->getNativeType()?->isSatisfiedBy(fn (Type$t) => $tinstanceof ObjectType && $this->resourceClassResolver->isResourceClass($t->getClassName()))) {
0 commit comments