public function appendCollectionAttributes(
        array $data,
        ErrorCollection $error,
        string $format,
        array $context
    ): array {
        $innerError = new ErrorResource(
            $error->getMessage(),
            $error->getReason(),
            $error->getPath(),
            $error->getAttributes(),
            $error->getIdentifier()
        );

        foreach ($error->getRelations() as $relation) {
            $innerError->addRelation($relation);
        }

        $normalizedInnerError = $this->normalizer->normalize($innerError, $format, $context);

        return array_merge($normalizedInnerError, $data);
    }