Skip to content

Commit 7dfba0c

Browse files
authored
docs(jsonld): drop misleading @type TODO, document intentional behavior (#8369)
1 parent 4a9a145 commit 7dfba0c

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

src/JsonLd/Serializer/ItemNormalizer.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,9 @@ private function resolveType(string $resourceClass, bool $isResourceClass, array
158158

159159
$types = $operation instanceof HttpOperation ? $operation->getTypes() : null;
160160
if (null === $types) {
161-
// TODO: 5.x break on this as this looks wrong, CollectionReferencingItem returns an IRI that point through
162-
// ItemReferencedInCollection but it returns a CollectionReferencingItem therefore we should use the current
163-
// object's class Type and not rely on operation ?
164161
if (isset($context['item_uri_template'])) {
165-
// When the operation comes from item_uri_template, use its shortName directly
166-
// as $resourceClass refers to the collection resource, not the item resource
162+
// The members carry the item resource's @type to match their @id, which dereferences
163+
// to the item_uri_template operation rather than to the collection's own resource.
167164
$types = [$operation->getShortName()];
168165
} else {
169166
// Use resource-level shortName to avoid operation-specific overrides

0 commit comments

Comments
 (0)