We are using the below bundles with Symfony2 to create a RESTful API.
new FOS\RestBundle\FOSRestBundle(),
new JMS\SerializerBundle\JMSSerializerBundle(),
new Nelmio\ApiDocBundle\NelmioApiDocBundle(),
We get the below error after running php composer.phar update
[2014-12-05 10:39:41] security.INFO: Populated SecurityContext with an anonymous Token [] []
[2014-12-05 10:39:41] request.CRITICAL: Uncaught PHP Exception LogicException: "The controller must return a response (Object(Symfony\Component\Form\Form) given)." at /var/www/html/symfony2/app/bootstrap.php.cache line 3020 {"exception":"[object] (LogicException: The controller must return a response (Object(Symfony\\Component\\Form\\Form) given). at /var/www/html/symfony2/app/bootstrap.php.cache:3020)"} []
[2014-12-05 10:39:41] security.DEBUG: Write SecurityContext in the session [] []
We installed Symfony2 on our server using the below steps
//install symfony
php composer.phar create-project symfony/framework-standard-edition symfony2/
//move composer into symfony folder
cp composer.phar symfony2/composer.phar
rm composer.phar
cd symfony2
//symfony dependencies
php composer.phar require doctrine/doctrine-fixtures-bundle
php composer.phar require "friendsofsymfony/rest-bundle" "@dev"
php composer.phar require "jms/serializer-bundle" "@dev"
php composer.phar require "nelmio/api-doc-bundle" "@dev"
The API requests return a 500 server error.
I have traced the error to the below point by am unsure why it is not working.
@Annotations\View(
templateVar = "form"
)
the ClassResourceInterface class is responsible for the above.
This may be related to this question but the solutions posted here do not work:
FOSRestBundle: The controller must return a response (Array()) given
Something is wrong with this class:
Nelmio\ApiDocBundle\Annotation\ApiDoc
Has anyone had issues with this as well?
Thank you