public function apply(Request $request, ParamConverter $configuration)
 {
     $name = $configuration->getName();
     $resourceUrl = is_string($request->attributes->get($name)) ? $request->attributes->get($name) : $request->query->get($name);
     if (!is_string($resourceUrl) || $resourceUrl === '') {
         return false;
     }
     try {
         $resourceObject = $this->resourceTransformer->getResource($resourceUrl);
         if (!is_a($resourceObject, $configuration->getClass())) {
             throw new BadRequestHttpException('Link to wrong resource type provided.');
         }
         if ($resourceObject) {
             $request->attributes->set($name, $resourceObject);
             return true;
         }
     } catch (\InvalidArgumentException $e) {
         // return false for invalid argument exception since this
         // only happens when the resource url is not valid.
     }
     return false;
 }