public function apply(Request $request, ParamConverterConfiguration $configuration)
    {
        $supportedParameters = [
            'tagId' => 'tag',
            'parentId' => 'parentTag',
        ];

        foreach ($supportedParameters as $source => $destination) {
            if (!$request->attributes->has($source)) {
                continue;
            }

            if (empty($request->attributes->get($source))) {
                if ($configuration->isOptional()) {
                    continue;
                }

                throw new InvalidArgumentException(
                    sprintf('Required request attribute "%s" is empty.', $source)
                );
            }

            $request->attributes->set(
                $destination,
                $this->tagsService->loadTag(
                    $request->attributes->get($source)
                )
            );
        }

        return true;
    }