diff --git a/src/Utils/AttributeFactory.php b/src/Utils/AttributeFactory.php index d5796194d..4436924cd 100644 --- a/src/Utils/AttributeFactory.php +++ b/src/Utils/AttributeFactory.php @@ -396,7 +396,10 @@ protected function mergeIntoSibling(array $attributes, int $index, array &$merge if ($candidate instanceof $targetClass) { if ($matchingTarget instanceof AttributeInterface) { throw OpenApiException::fromSource( - sprintf('Ambiguous merge: %s matches multiple siblings on the same target', $attribute::class), + sprintf( + 'Ambiguous merge: %s matches multiple siblings on the same target. Nest it explicitly in the one it belongs to, or give it a `component` and reference it from each.', + $attribute::class + ), $attribute->getSourceLocation(), ); }