JMSSerializer - изображение класса не существует - PullRequest
0 голосов
/ 26 ноября 2018

У меня есть приложение Symfony 4 с jms / serializer-bundle v2.4.2 .

Когда я пытаюсь получить доступ к странице, которая использует сериализатор, я получаю сообщение об ошибке ниже:

Кто-нибудь знает, что его вызывает?

ReflectionException:
Class image does not exist

  at vendor/jms/metadata/src/Metadata/MetadataFactory.php:151
  at ReflectionClass->__construct('image')
     (vendor/jms/metadata/src/Metadata/MetadataFactory.php:151)
  at Metadata\MetadataFactory->getClassHierarchy('image')
     (vendor/jms/metadata/src/Metadata/MetadataFactory.php:56)
  at Metadata\MetadataFactory->getMetadataForClass('image')
     (vendor/jms/serializer/src/JMS/Serializer/GraphNavigator.php:193)
  at JMS\Serializer\GraphNavigator->accept('57dfebb91def3.png', array('name' => 'image', 'params' => array()), object(SerializationContext))
     (vendor/jms/serializer/src/JMS/Serializer/JsonSerializationVisitor.php:145)
  at JMS\Serializer\JsonSerializationVisitor->visitProperty(object(PropertyMetadata), object(Organization), object(SerializationContext))
     (vendor/jms/serializer/src/JMS/Serializer/GraphNavigator.php:248)
  at JMS\Serializer\GraphNavigator->accept(object(Organization), array('name' => 'Core\\Domain\\Model\\Organization', 'params' => array()), object(SerializationContext))
     (vendor/jms/serializer/src/JMS/Serializer/JsonSerializationVisitor.php:97)
  at JMS\Serializer\JsonSerializationVisitor->visitArray(array(object(Organization)), array('name' => 'array', 'params' => array()), object(SerializationContext))
     (vendor/jms/serializer/src/JMS/Serializer/GraphNavigator.php:134)
  at JMS\Serializer\GraphNavigator->accept(array(object(Organization)), array('name' => 'array', 'params' => array()), object(SerializationContext))
     (vendor/jms/serializer/src/JMS/Serializer/JsonSerializationVisitor.php:145)
  at JMS\Serializer\JsonSerializationVisitor->visitProperty(object(PropertyMetadata), object(SuccessApiResponse), object(SerializationContext))
     (vendor/jms/serializer/src/JMS/Serializer/GraphNavigator.php:248)
  at JMS\Serializer\GraphNavigator->accept(object(SuccessApiResponse), array('name' => 'AppBundle\\Response\\Api\\SuccessApiResponse', 'params' => array()), object(SerializationContext))
     (vendor/jms/serializer/src/JMS/Serializer/Serializer.php:177)
  at JMS\Serializer\Serializer->visit(object(JsonSerializationVisitor), object(SerializationContext), object(SuccessApiResponse), 'json', null)
     (vendor/jms/serializer/src/JMS/Serializer/Serializer.php:96)
  at JMS\Serializer\Serializer->JMS\Serializer\{closure}(object(JsonSerializationVisitor))
  at call_user_func(object(Closure), object(JsonSerializationVisitor))
     (vendor/phpoption/phpoption/src/PhpOption/Some.php:89)
  at PhpOption\Some->map(object(Closure))
     (vendor/jms/serializer/src/JMS/Serializer/Serializer.php:99)
  at JMS\Serializer\Serializer->serialize(object(SuccessApiResponse), 'json', object(SerializationContext))
     (src/Core/Infrastructure/Serialization/JMSSerializerObjectSerializer.php:36)
  at Core\Infrastructure\Serialization\JMSSerializerObjectSerializer->serialize(object(SuccessApiResponse), array('Default', 'rest_api'))
     (src/AppBundle/Controller/Controller.php:52)
  at AppBundle\Controller\Controller->serialize(object(SuccessApiResponse))
     (src/AppBundle/Controller/Controller.php:57)
  at AppBundle\Controller\Controller->createApiResponse(object(SuccessApiResponse), 200)
     (src/AppBundle/Controller/Controller.php:72)
  at AppBundle\Controller\Controller->returnApiResponse(object(SuccessApiResponse))
...