-
Notifications
You must be signed in to change notification settings - Fork 6
WIP: Upgrade dependencies, allow Symfony 4 #3
Conversation
@din-gi can you please test this branch, which supports Symfony 4? It should be specified like this in |
I have installed the package but for some reason it tells me: this is after adding the following to
And the following to
Have any idea why? Thanks for the help :) |
Adding a serivce manually should not be necessary - that's what the bundle is doing. Only registering the bundle in Have you cleaned-up the cache? (just in case :-) ) I tested it yesterday. I had a testing class: <?php declare(strict_types = 1);
namespace App;
use JMS\Serializer\Annotation as JMS;
class User
{
/**
* @JMS\Type("uuid")
* @var \Ramsey\Uuid\UuidInterface
*/
public $id;
} And a DemoController: <?php
namespace App\Controller;
use App\User;
use JMS\Serializer\SerializerInterface;
use Ramsey\Uuid\Uuid;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Routing\Annotation\Route;
class DemoController extends Controller
{
/** @var \JMS\Serializer\SerializerInterface */
private $serializer;
/**
*/
public function __construct(
SerializerInterface $serializer
)
{
$this->serializer = $serializer;
}
/**
* @Route("/")
* @return \Symfony\Component\HttpFoundation\Response
*/
public function demoAction()
{
$user = new User();
$user->id = Uuid::uuid4();
return new JsonResponse(
$this->serializer->serialize($user, 'json')
);
}
} |
Hey.. so I got some time today to check everything.. So turns out I was using the wrong serializer (I had couple of instances) and that my used instance didn't have the UUID extension registered.. Again - sorry.. Everything seems to be working well - if you can approve the pull so that it will stick to the master that will be amazing :) Thanks a bunch! |
@dinbrca merged and released as |
Closes #2