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
The links are lost due to the ExclusionManager which skip these links, the workaround which works in my projetc is to not skip these relations when exclusion is nullable
// \Hateoas\Serializer\ExclusionManager.phpprivatefunctionshouldSkip($object, Exclusion$exclusion = null, SerializationContext$context)
{
// Do not skip links when exclusion is nullif (is_null($exclusion)) {
returnfalse;
}
if (null !== $exclusion
&& null !== $exclusion->getExcludeIf()
&& $this->expressionEvaluator->evaluate($exclusion->getExcludeIf(), $object)
) {
returntrue;
}
if (!$context->getExclusionStrategy()) {
returnfalse;
}
$propertyMetadata = newRelationPropertyMetadata($exclusion);
return$context->getExclusionStrategy()->shouldSkipProperty($propertyMetadata, $context);
}
But I do not have enough global understanding to know if it's a good or a bad workaround. Do you have any idea how this problem can be resolved properly ?
The text was updated successfully, but these errors were encountered:
Now, this relation will be serialized for the groups "list" and "detail".
(Not sure about this, but is it the behaviour we expect from an exclusion policy ?)
The links are lost when the serialization groups are used :
The links are lost due to the ExclusionManager which skip these links, the workaround which works in my projetc is to not skip these relations when exclusion is nullable
But I do not have enough global understanding to know if it's a good or a bad workaround. Do you have any idea how this problem can be resolved properly ?
The text was updated successfully, but these errors were encountered: